Package org.opencastproject.util
Class EnumSupport
java.lang.Object
org.opencastproject.util.EnumSupport
Enum utility methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Enum<?>>
EfromString(Class<E> enumClass, String value) Support method to help enums implement an enhancedvalueOf(String)method, that does not throw an IllegalArgumentException in case of incoming values, that do not match any of the enum's values.parseEnum(A e) Create a function to parse a string into an Enum value.
-
Method Details
-
fromString
Support method to help enums implement an enhancedvalueOf(String)method, that does not throw an IllegalArgumentException in case of incoming values, that do not match any of the enum's values.- Parameters:
enumClass- the enum's classvalue- the value to look up- Returns:
- the matching enum value or null if none matches
-
parseEnum
Create a function to parse a string into an Enum value.
-