Class BsonHelper
java.lang.Object
fr.gouv.vitam.common.database.server.mongodb.BsonHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.JsonNode
fromDocumentToJsonNode
(org.bson.Document object) Convert bson document to JsonNodestatic <T> T
fromDocumentToObject
(org.bson.Document document, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) Convert bson document to objectstatic <T> T
fromDocumentToObject
(org.bson.Document document, Class<T> clasz) Convert bson document to objectstatic String
stringify
(org.bson.Document document) Stringify mongo document
-
Constructor Details
-
BsonHelper
public BsonHelper()
-
-
Method Details
-
stringify
Stringify mongo document- Parameters:
document
-- Returns:
- Unpretty print object
-
fromDocumentToJsonNode
public static com.fasterxml.jackson.databind.JsonNode fromDocumentToJsonNode(org.bson.Document object) throws InvalidParseOperationException Convert bson document to JsonNode- Throws:
InvalidParseOperationException
-
fromDocumentToObject
public static <T> T fromDocumentToObject(org.bson.Document document, Class<T> clasz) throws InvalidParseOperationException Convert bson document to object- Throws:
InvalidParseOperationException
-
fromDocumentToObject
public static <T> T fromDocumentToObject(org.bson.Document document, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) throws InvalidParseOperationException Convert bson document to object- Throws:
InvalidParseOperationException
-