Enum Class CoercionMode
- All Implemented Interfaces:
Serializable, Comparable<CoercionMode>, Constable
The baseline for the scalar coercions a decoder performs. Individual coercions can always be
turned on or off explicitly, the mode only decides the default for the ones that are not
configured.
- Since:
- 3.2
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic CoercionModeReturns the enum constant of this class with the specified name.static CoercionMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LENIENT
Values of the wrong shape are coerced where a sensible conversion exists, for example a JSON string is read into anintproperty. This is the historical behaviour. -
STRICT
Values must have the shape of the target type. A JSON string is not read into anintproperty, a floating point number is not read into an integer property, and so on.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-