Class CustomJacksonCodec<T>

java.lang.Object
org.mongojack.internal.stream.JacksonCodec<T>
org.graylog2.database.jackson.CustomJacksonCodec<T>
All Implemented Interfaces:
org.bson.codecs.Codec<T>, org.bson.codecs.CollectibleCodec<T>, org.bson.codecs.Decoder<T>, org.bson.codecs.Encoder<T>, org.bson.codecs.OverridableUuidRepresentationCodec<T>

public class CustomJacksonCodec<T> extends org.mongojack.internal.stream.JacksonCodec<T>
A custom implementation of Mongojack's JacksonCodec that doesn't attempt to modify potentially immutable domain objects, because that sometimes just isn't possible, e.g. for Records.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomJacksonCodec(org.mongojack.internal.stream.JacksonEncoder<T> encoder, org.mongojack.internal.stream.JacksonDecoder<T> decoder, com.fasterxml.jackson.databind.ObjectMapper objectMapper, CustomJacksonCodecRegistry jacksonCodecRegistry)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.bson.codecs.Codec<T>
    withUuidRepresentation(org.bson.UuidRepresentation uuidRepresentation)
     

    Methods inherited from class org.mongojack.internal.stream.JacksonCodec

    constructIdValue, decode, documentHasId, encode, getDocumentId, getEncoderClass, getIdElementDeserializationDescription, getIdElementSerializationDescription

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CustomJacksonCodec

      public CustomJacksonCodec(org.mongojack.internal.stream.JacksonEncoder<T> encoder, org.mongojack.internal.stream.JacksonDecoder<T> decoder, com.fasterxml.jackson.databind.ObjectMapper objectMapper, CustomJacksonCodecRegistry jacksonCodecRegistry)
  • Method Details

    • generateIdIfAbsentFromDocument

      public T generateIdIfAbsentFromDocument(T t)
      Specified by:
      generateIdIfAbsentFromDocument in interface org.bson.codecs.CollectibleCodec<T>
      Overrides:
      generateIdIfAbsentFromDocument in class org.mongojack.internal.stream.JacksonCodec<T>
    • withUuidRepresentation

      public org.bson.codecs.Codec<T> withUuidRepresentation(org.bson.UuidRepresentation uuidRepresentation)
      Specified by:
      withUuidRepresentation in interface org.bson.codecs.OverridableUuidRepresentationCodec<T>
      Overrides:
      withUuidRepresentation in class org.mongojack.internal.stream.JacksonCodec<T>