Enum Class DecodeMethod

java.lang.Object
java.lang.Enum<DecodeMethod>
com.github.cafapi.common.api.DecodeMethod
All Implemented Interfaces:
Serializable, Comparable<DecodeMethod>, Constable

public enum DecodeMethod extends Enum<DecodeMethod>
Dictates the decoding method for a Codec, specifying whether the Codec should perform strict decoding or be more lenient which can help in being tolerant to data from a subtly different class version of the object.
  • Enum Constant Details

    • STRICT

      public static final DecodeMethod STRICT
      A "strict" Codec should not allow unknown fields. It may also reject inputs with duplicate fields or fields that are null when null is not allowed.
    • LENIENT

      public static final DecodeMethod LENIENT
      A "lenient" Codec may accept but ignore unknown fields, and may also accept duplicate entries within the input data (though how this behaves may be undefined). Unexpected nulls may be replaced with the primitive defaults.
  • Method Details

    • values

      public static DecodeMethod[] 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 DecodeMethod 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
    • getDefault

      public static DecodeMethod getDefault()
      Returns:
      the default, assumed DecodeMethod