Package com.saperion.util
Class EnumConstant
java.lang.Object
com.saperion.util.EnumConstant
Utility class that can be used to safely retrieve enum constants by their position in the value-array.
-
Method Summary
-
Method Details
-
get
Retrieves the enum-constant at the specified position in the value-array of the Enum defined by the specified class. If the class is not an Enum, or if there is no constant at the specified position in the array, the default value will be returned.- Type Parameters:
T
- the type of the Enum- Parameters:
clazz
- Class defining the Enum to read fromposition
- the position of the constant in the value-arraydefaultValue
- the default value to return if no constant was found- Returns:
- enum constant or default value, if no constant was found
-