Package de.bild.codec

Interface TypeCodec<T>

Type Parameters:
T - the value type
All Superinterfaces:
org.bson.codecs.Codec<T>, org.bson.codecs.Decoder<T>, org.bson.codecs.Encoder<T>
All Known Subinterfaces:
PolymorphicCodec<T>, ReflectionCodec<T>
All Known Implementing Classes:
AbstractTypeCodec, ArrayCodec, BasicReflectionCodec, CollectionTypeCodec, ComplexMapTypeCodec, ListTypeCodec, MapTypeCodec, PolymorphicReflectionCodec, SetTypeCodec, SimpleMapTypeCodec, SpecialFieldsMapCodec

public interface TypeCodec<T> extends org.bson.codecs.Codec<T>
All codecs used within polymorphia need to implement this interface.
  • Method Details

    • defaultInstance

      default T defaultInstance()
      Override this method if your Codec needs to supply default values as replacements for null values.
      Returns:
      null or a default value
    • isCollectible

      default boolean isCollectible()
    • generateIdIfAbsentFromDocument

      default T generateIdIfAbsentFromDocument(T document)
    • documentHasId

      default boolean documentHasId(T document)
    • getDocumentId

      default org.bson.BsonValue getDocumentId(T document)
    • getTypeFilter

      default org.bson.conversions.Bson getTypeFilter()
    • getDecodingPojoFailureStrategy

      default DecodingPojoFailureStrategy.Strategy getDecodingPojoFailureStrategy()