Package de.bild.codec.annotations
Annotation Interface DecodeUndefinedHandlingStrategy
@Documented
@Inherited
@Retention(RUNTIME)
@Target({FIELD,TYPE})
public @interface DecodeUndefinedHandlingStrategy
This strategy can be used to influence field values while decoding if no value is found in the database.
This comes in quite handy if your data model evolves and you find properties not to be encoded for old Pojos.
A global default value can be set via
PojoCodecProvider.Builder.decodeUndefinedHandlingStrategy(Strategy)
If not set, default is DecodeUndefinedHandlingStrategy.Strategy.KEEP_POJO_DEFAULT (due to historical behaviour of PojoCodecProvider)
You can use this annotation at class level or at field level. If you use it at class level, you can override each field with
a field level annotation.
DecodeUndefinedHandlingStrategy.Strategy.SET_TO_NULLsets the value of the field to null, even if the pojo provides a default valueDecodeUndefinedHandlingStrategy.Strategy.CODECTypeCodec.defaultInstance()is being used to initialize the field, even if the pojo provides a default valueDecodeUndefinedHandlingStrategy.Strategy.KEEP_POJO_DEFAULTkeeps the pojo default, could be null or anything set during creation (constructor or default initialization of the field)
-
Nested Class Summary
Nested Classes -
Required Element Summary
Required Elements
-
Element Details
-
value
-