public enum CoercionAction extends Enum<CoercionAction>
CoercionInputShape
that does not directly or naturally match target type
(LogicalType
).
This action is suggestion for deserializers to use in cases
where alternate actions could be appropriate: it is up to deserializer
to check configured action and take it into consideration.Enum Constant and Description |
---|
AsEmpty
Action to convert to "empty" value for type, whatever that is: for
primitive types and their wrappers this is "default" value (for example,
for
int that would be 0 ); for Collection s
empty collection; for POJOs instance configured with default constructor
and so on. |
AsNull
Action to convert to
null value |
Fail
Action to fail coercion attempt with exceptipn
|
TryConvert
Action to attempt coercion (which may lead to failure)
|
Modifier and Type | Method and Description |
---|---|
static CoercionAction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CoercionAction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CoercionAction Fail
public static final CoercionAction TryConvert
public static final CoercionAction AsNull
null
valuepublic static final CoercionAction AsEmpty
int
that would be 0
); for Collection
s
empty collection; for POJOs instance configured with default constructor
and so on.public static CoercionAction[] values()
for (CoercionAction c : CoercionAction.values()) System.out.println(c);
public static CoercionAction valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2008–2020 FasterXML. All rights reserved.