java.lang.Object
org.sejda.conversion.EnumUtils
Utilities related to
Enums- Author:
- Eduard Weissmann
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Enum<?> & FriendlyNamed>
Tstatic <T extends Enum<?> & FriendlyNamed>
TvalueOfSilently(Class<T> enumClass, String displayName)
-
Method Details
-
valueOfSilently
public static <T extends Enum<?> & FriendlyNamed> T valueOfSilently(Class<T> enumClass, String displayName) - Parameters:
enumClass-displayName-- Returns:
- Returns the enum value matching the input displayName, belonging to the specified enum class Does not throw an exception if enum value is not found, returns null
-
valueOf
public static <T extends Enum<?> & FriendlyNamed> T valueOf(Class<T> enumClass, String displayName, String describedEnumClass) - Parameters:
enumClass-displayName-describedEnumClass-- Returns:
- Returns the enum value matching the input displayName, belonging to the specified enum class
- Throws:
SejdaRuntimeException- if enum value is not found, mentioning the valid values in the message
-