Package de.bild.codec.annotations
Annotation Interface EncodeNullHandlingStrategy
@Documented
@Inherited
@Retention(RUNTIME)
@Target({FIELD,TYPE})
public @interface EncodeNullHandlingStrategy
Use this annotation to specify the handling of null values prior to encoding to the database.
This annotation is thought for convenience.
You can use it at class level or at field level. If you use it at class level, you can override each field with
a field level annotation.
A global default value can be set via
PojoCodecProvider.Builder.encodeNullHandlingStrategy(Strategy)
If not set, default is EncodeNullHandlingStrategy.Strategy.CODEC (due to historical behaviour of PojoCodecProvider)
You can e.g. make sure, that lists fields that are null are always encoded as empty lists, if desired.
Right now, two strategies exist:
EncodeNullHandlingStrategy.Strategy.CODEC: If null is found thenTypeCodec.defaultInstance()is being used to generate a default value e.g. empty list/set/mapEncodeNullHandlingStrategy.Strategy.KEEP_NULL: keep null
-
Nested Class Summary
Nested Classes -
Required Element Summary
Required Elements
-
Element Details
-
value
-