Enum Class EnumGetMethod
- All Implemented Interfaces:
Serializable,Comparable<EnumGetMethod>,Constable
Specifies how to treat non-enum values when using
UnmodifiableConfig.getEnum(String, Class, EnumGetMethod).-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIf the config value is an enum constant, returns it as it is.If the config value is an enum constant, returns it as it is.If the config value is an enum constant, returns it as it is.If the config value is an enum constant, returns it as it is. -
Method Summary
Modifier and TypeMethodDescription<T extends Enum<T>>
Tbooleanboolean<T extends Enum<T>>
booleanstatic EnumGetMethodReturns the enum constant of this class with the specified name.static EnumGetMethod[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NAME
If the config value is an enum constant, returns it as it is. If it's a String, returns the enum constant whose name exactly matches the string (string case-sensitive equality). If it's a value of another type, throws an error. In particular, throws an error if it's an Integer. -
NAME_IGNORECASE
If the config value is an enum constant, returns it as it is. If it's a String, returns the enum constant whose name matches the string, ignoring the case. If it's a value of another type, throws an error. In particular, throws an error if it's an Integer. This is the default method used byUnmodifiableConfig(and other classes) when not explicitely specified. -
ORDINAL_OR_NAME
If the config value is an enum constant, returns it as it is. If it's a String, returns the enum constant whose name exactly matches the string (string case-sensitive equality). If it's an Integer, returns the enum constant whoseordinal()is equal to the value. If it's a value of another type, throws an error. -
ORDINAL_OR_NAME_IGNORECASE
If the config value is an enum constant, returns it as it is. If it's a String, returns the enum constant whose name exactly matches the string. If it's an Integer, returns the enum constant whoseordinal()is equal to the value. If it's a value of another type, throws an error.
-
-
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
-
isCaseSensitive
public boolean isCaseSensitive() -
isOrdinalOk
public boolean isOrdinalOk() -
get
-
validate
-