Enum Class CoercionPolicy.Shape
- All Implemented Interfaces:
Serializable, Comparable<CoercionPolicy.Shape>, Constable
- Enclosing class:
CoercionPolicy
The shape of a value in the document, as far as coercion is concerned.
- Since:
- 3.2
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn array, which a decoder may unwrap if it holds a single value.A boolean.A number with a fractional part.A number without a fractional part.Anything else: null, objects, structural tokens, format specific values.A string. -
Method Summary
Modifier and TypeMethodDescriptionintbit()static CoercionPolicy.ShapeReturns the enum constant of this class with the specified name.static CoercionPolicy.Shape[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STRING
A string. -
INTEGER_NUMBER
A number without a fractional part. -
FLOAT_NUMBER
A number with a fractional part. -
BOOLEAN
A boolean. -
ARRAY
An array, which a decoder may unwrap if it holds a single value. -
OTHER
Anything else: null, objects, structural tokens, format specific values. These are never coerced, the decoder rejects or handles them on its own.
-
-
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
-
bit
public int bit()- Returns:
- This shape as a bit, to test against
CoercionPolicy.allowedShapes(Target)
-