Package de.bild.codec

Class MappedField<T,F>

java.lang.Object
de.bild.codec.MappedField<T,F>
Type Parameters:
T - The type of the persistence class container (pojo) for this mapped field
F - The type of the field value

public class MappedField<T,F> extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getAnnotation

      public <T extends Annotation> T getAnnotation(Class<T> clazz)
      Type Parameters:
      T - the type of the annotation
      Parameters:
      clazz - the annotation to search for
      Returns:
      the annotation instance if it exists on this field
    • getAnnotations

      public Map<Class<? extends Annotation>,Annotation> getAnnotations()
      Returns:
      the annotations found while mapping
    • hasAnnotation

      public boolean hasAnnotation(Class ann)
      Indicates whether the annotation is present in the mapping (does not check the java field annotations, just the ones discovered)
      Parameters:
      ann - the annotation to search for
      Returns:
      true if the annotation was found
    • getMappedFieldName

      public String getMappedFieldName()
    • getField

      public Field getField()
      Returns:
      the underlying java field
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setFieldValue

      public boolean setFieldValue(T instance, F value)
    • getFieldValue

      public F getFieldValue(T instance)
    • encode

      public void encode(org.bson.BsonWriter writer, T instance, org.bson.codecs.EncoderContext encoderContext)
    • decode

      public void decode(org.bson.BsonReader reader, T instance, org.bson.codecs.DecoderContext decoderContext)
    • getFieldTypePair

      public FieldTypePair getFieldTypePair()
    • isIdField

      public boolean isIdField()
    • isLockingVersionField

      public boolean isLockingVersionField()
    • getCodec

      public org.bson.codecs.Codec getCodec()
    • initializeUndefinedValue

      public void initializeUndefinedValue(T instance)
      Parameters:
      instance - to initialize