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 fieldF- The type of the field value
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMappedField(FieldTypePair fieldTypePair, Class<T> persistedClass, TypeCodecRegistry typeCodecRegistry, CodecConfiguration codecConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidboolean<T extends Annotation>
TgetAnnotation(Class<T> clazz) Map<Class<? extends Annotation>,Annotation> org.bson.codecs.CodecgetCodec()getField()getFieldValue(T instance) booleanhasAnnotation(Class ann) Indicates whether the annotation is present in the mapping (does not check the java field annotations, just the ones discovered)inthashCode()voidinitializeUndefinedValue(T instance) booleanbooleanbooleansetFieldValue(T instance, F value)
-
Field Details
-
ID_KEY
- See Also:
-
-
Constructor Details
-
MappedField
public MappedField(FieldTypePair fieldTypePair, Class<T> persistedClass, TypeCodecRegistry typeCodecRegistry, CodecConfiguration codecConfiguration)
-
-
Method Details
-
getAnnotation
- 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
- Returns:
- the annotations found while mapping
-
hasAnnotation
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
-
getField
- Returns:
- the underlying java field
-
equals
-
hashCode
public int hashCode() -
setFieldValue
-
getFieldValue
-
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
-
isIdField
public boolean isIdField() -
isLockingVersionField
public boolean isLockingVersionField() -
getCodec
public org.bson.codecs.Codec getCodec() -
initializeUndefinedValue
- Parameters:
instance- to initialize
-