java.lang.Object
io.github.palexdev.materialfx.utils.EnumUtils
Utility class which provides convenience methods for enumerators
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Enum<E>>
ErandomEnum(Class<E> clazz) Given an enumerator (as a class) retrieves a random constant usingClass.getEnumConstants().static <E extends Enum<E>>
EvalueOfIgnoreCase(Class<E> clazz, String name) Checks if the given enumerator (as a class) contains the given String, same asEnum.valueOf(Class, String)but case-insensitive.
-
Method Details
-
valueOfIgnoreCase
Checks if the given enumerator (as a class) contains the given String, same asEnum.valueOf(Class, String)but case-insensitive.- Parameters:
clazz- the Class object of the enum class from which to return a constantname- the name of the constant to return- Returns:
- the enum constant of the specified enum class with the specified name
-
randomEnum
Given an enumerator (as a class) retrieves a random constant usingClass.getEnumConstants().
-