Enum Class CoercionPolicy.Shape

java.lang.Object
java.lang.Enum<CoercionPolicy.Shape>
io.micronaut.serde.config.CoercionPolicy.Shape
All Implemented Interfaces:
Serializable, Comparable<CoercionPolicy.Shape>, Constable
Enclosing class:
CoercionPolicy

public static enum CoercionPolicy.Shape extends Enum<CoercionPolicy.Shape>
The shape of a value in the document, as far as coercion is concerned.
Since:
3.2
Author:
Denis Stepanov
  • Enum Constant Details

    • STRING

      public static final CoercionPolicy.Shape STRING
      A string.
    • INTEGER_NUMBER

      public static final CoercionPolicy.Shape INTEGER_NUMBER
      A number without a fractional part.
    • FLOAT_NUMBER

      public static final CoercionPolicy.Shape FLOAT_NUMBER
      A number with a fractional part.
    • BOOLEAN

      public static final CoercionPolicy.Shape BOOLEAN
      A boolean.
    • ARRAY

      public static final CoercionPolicy.Shape ARRAY
      An array, which a decoder may unwrap if it holds a single value.
    • OTHER

      public static final CoercionPolicy.Shape 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

      public static CoercionPolicy.Shape[] 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

      public static CoercionPolicy.Shape valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • bit

      public int bit()
      Returns:
      This shape as a bit, to test against CoercionPolicy.allowedShapes(Target)