Enum Class EnumParser.ParseTarget

java.lang.Object
java.lang.Enum<EnumParser.ParseTarget>
org.klojang.convert.EnumParser.ParseTarget
All Implemented Interfaces:
Serializable, Comparable<EnumParser.ParseTarget>, Constable
Enclosing class:
EnumParser<T extends Enum<T>>

public static enum EnumParser.ParseTarget extends Enum<EnumParser.ParseTarget>
Symbolic constants for what the value to be converted represents.
Author:
Ayco Holleman
  • Enum Constant Details

    • NAME

      public static final EnumParser.ParseTarget NAME
      Indicates that the value to be converted is supposed to be the name of an enum constant.
    • ORDINAL

      public static final EnumParser.ParseTarget ORDINAL
      Indicates that the value to be converted is supposed to be the ordinal value of an enum constant.
    • TO_STRING

      public static final EnumParser.ParseTarget TO_STRING
      Indicates that the value to be converted is supposed to be the string representation of an enum constant.
    • IDENTITY

      public static final EnumParser.ParseTarget IDENTITY
      Indicates that the value to be converted is supposed to be already an enum constant and must be returned as-is by the parser. This may be useful in dynamic contexts where it is not known beforehand whether the incoming value perhaps already is (or has been converted to) an enum constant.
  • Method Details

    • values

      public static EnumParser.ParseTarget[] 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 EnumParser.ParseTarget 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