Enum Class EnumParser.ParseTarget
- All Implemented Interfaces:
Serializable
,Comparable<EnumParser.ParseTarget>
,Constable
- Enclosing class:
EnumParser<T extends Enum<T>>
Symbolic constants for what the value to be converted represents.
- Author:
- Ayco Holleman
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndicates that the value to be converted is supposed to be already an enum constant and must be returned as-is by the parser.Indicates that the value to be converted is supposed to be the name of an enum constant.Indicates that the value to be converted is supposed to be the ordinal value of an enum constant.Indicates that the value to be converted is supposed to be the string representation of an enum constant. -
Method Summary
Modifier and TypeMethodDescriptionstatic EnumParser.ParseTarget
Returns the enum constant of this class with the specified name.static EnumParser.ParseTarget[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NAME
Indicates that the value to be converted is supposed to be the name of an enum constant. -
ORDINAL
Indicates that the value to be converted is supposed to be the ordinal value of an enum constant. -
TO_STRING
Indicates that the value to be converted is supposed to be the string representation of an enum constant. -
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
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
-