Class DocumentSerializationUtils


  • public class DocumentSerializationUtils
    extends Object
    Utilities for helping with serialisation
    • Constructor Detail

      • DocumentSerializationUtils

        public DocumentSerializationUtils()
    • 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 of
        registry - 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)