![JAR search and dependency download from the Maven repository](/logo.png)
com.lordofthejars.nosqlunit.marklogic.content.DataSetReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nosqlunit-marklogic Show documentation
Show all versions of nosqlunit-marklogic Show documentation
NoSQLUnit adapter for MarkLogic
The newest version!
package com.lordofthejars.nosqlunit.marklogic.content;
import com.marklogic.client.document.DocumentManager;
import com.marklogic.client.io.marker.ContentHandle;
import com.marklogic.client.io.marker.ContentHandleFactory;
import java.util.Map;
import java.util.Set;
import static java.util.stream.Collectors.toMap;
public class DataSetReader {
private DocumentManager documentManager;
private ContentHandleFactory contentHandleFactory;
public DataSetReader(DocumentManager documentManager, ContentHandleFactory contentHandleFactory) {
this.documentManager = documentManager;
this.contentHandleFactory = contentHandleFactory;
}
public Map> read(Set contents, Class type) {
return contents.stream().collect(toMap(Content::getUri, c ->
(ContentHandle) documentManager.read(c.getUri(), contentHandleFactory.newHandle(type))
)
);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy