public static enum SerdeDefault.WhenValue extends java.lang.Enum<SerdeDefault.WhenValue>
The default value is used if the condition is true.
| Enum Constant and Description |
|---|
IS_EMPTY
When deserializing a field, set it to its default value if the value from the
config is empty.
|
IS_MISSING
When deserializing a field, call the default value provider if the value is
missing from the config.
|
IS_NULL
When deserializing a field, set it to its default value if the value from the
config is null.
|
| Modifier and Type | Method and Description |
|---|---|
static SerdeDefault.WhenValue |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static SerdeDefault.WhenValue[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SerdeDefault.WhenValue IS_MISSING
This does nothing when serializing, because a field cannot be missing.
public static final SerdeDefault.WhenValue IS_NULL
When serializing a field, serialize the default value instead of the field's value if the latter is null.
public static final SerdeDefault.WhenValue IS_EMPTY
When serializing a field, serialize the default value instead of the field's value if the latter is empty.
Determining whether an object is "empty" or not is done in a "logical" way
for common Java objects.
For instance, a CharSequence is empty is its length() is
zero, a Collection is empty if calling isEmpty() returns
true, etc.
As a last-resort try to implement the "is empty" check, reflection is used to
find and call the method boolean isEmpty() on the value.
public static SerdeDefault.WhenValue[] values()
for (SerdeDefault.WhenValue c : SerdeDefault.WhenValue.values()) System.out.println(c);
public static SerdeDefault.WhenValue valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is null