Package org.forgerock.openig.util
Class EnumUtil
java.lang.Object
org.forgerock.openig.util.EnumUtil
Utility class for accessing Java enum types.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a set of the names of the enum constants of the specified enum type.static <T extends Enum<T>>
TReturns the enum constant of the specified enum type with the specified name.
-
Method Details
-
names
Returns a set of the names of the enum constants of the specified enum type. The returned set maintains iteration order of the constants in the order they're declared in the enum type.- Type Parameters:
T
- enumeration type- Parameters:
enumType
- the class of the enum type from which to return the names.- Returns:
- a set of the names of the enum constants in the specified enum.
-
valueOf
Returns the enum constant of the specified enum type with the specified name.- Type Parameters:
T
- enumeration type- Parameters:
enumType
- The class of the enum type from which to return a constant.name
- The name of the constant to return.- Returns:
- The matching enum constant or
IllegalArgumentException
if no match found. - Throws:
IllegalArgumentException
- if no match found.
-