Package org.mongojack.internal.util
Class DocumentSerializationUtils
- java.lang.Object
-
- org.mongojack.internal.util.DocumentSerializationUtils
-
public class DocumentSerializationUtils extends Object
Utilities for helping with serialisation
-
-
Constructor Summary
Constructors Constructor Description DocumentSerializationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.mongojack.internal.util.DocumentSerializationUtilsApi
getInstance()
static boolean
isKnownClass(Class<?> value)
static boolean
isKnownType(Object value)
static org.bson.conversions.Bson
serializeFields(org.bson.conversions.Bson object, org.bson.codecs.configuration.CodecRegistry registry)
Serialize the fields of the given object using the given object mapper.static org.bson.conversions.Bson
serializeFilter(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.JavaType type, org.bson.conversions.Bson query, org.bson.codecs.configuration.CodecRegistry registry)
static org.bson.conversions.Bson
serializeUpdates(Map<String,Map<String,UpdateOperationValue>> update, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.JavaType javaType, org.bson.codecs.configuration.CodecRegistry registry)
static void
setInstance(org.mongojack.internal.util.DocumentSerializationUtilsApi instance)
static boolean
writeKnownType(Object value, org.bson.BsonWriter writer)
-
-
-
Method Detail
-
serializeFields
public static org.bson.conversions.Bson serializeFields(org.bson.conversions.Bson object, org.bson.codecs.configuration.CodecRegistry registry)
Serialize the fields of the given object using the given object mapper. This will convert POJOs to Documents where necessary.- Parameters:
object
- The object to serialize the fields ofregistry
- Codec registry- Returns:
- The Document, safe for serialization to MongoDB
-
writeKnownType
public static boolean writeKnownType(Object value, org.bson.BsonWriter writer)
-
isKnownType
public static boolean isKnownType(Object value)
-
isKnownClass
public static boolean isKnownClass(Class<?> value)
-
serializeFilter
public static org.bson.conversions.Bson serializeFilter(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.JavaType type, org.bson.conversions.Bson query, org.bson.codecs.configuration.CodecRegistry registry)
-
serializeUpdates
public static org.bson.conversions.Bson serializeUpdates(Map<String,Map<String,UpdateOperationValue>> update, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.JavaType javaType, org.bson.codecs.configuration.CodecRegistry registry)
-
getInstance
public static org.mongojack.internal.util.DocumentSerializationUtilsApi getInstance()
-
setInstance
public static void setInstance(org.mongojack.internal.util.DocumentSerializationUtilsApi instance)
-
-