@JsonbAnnotation
@Retention(RUNTIME)
@Target({ANNOTATION_TYPE,FIELD,METHOD,TYPE,PACKAGE})
public @interface JsonbNillable
Specifies how fields having null values are serialized into JSON.
There are two possible values which can be specified. In case of true, fields are serialized as key/value pair with value null. In case of false, fields will not be serialized (default behaviour).
The annotation can be specified on a field, method, type, or package, and affects all underlying properties and classes.
For similar functionality on a property level see JsonbProperty.
However, the JsonbProperty.nillable() functionality has been deprecated
and should not be used.
- Since:
- JSON Binding 1.0
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanSwitches on/off serialization of properties with null value.
-
Element Details
-
value
boolean valueSwitches on/off serialization of properties with null value.- Returns:
- True if field with null value should be serialized as key/value pair into JSON with null value.
- Default:
- true
-