Package wtf.choco.veinminer.util
Class EnumUtil
java.lang.Object
wtf.choco.veinminer.util.EnumUtil
A utility class to more easily operate with enums.
-
Method Summary
-
Method Details
-
get
@NotNull public static <E extends Enum<E>> @NotNull Optional<E> get(@NotNull @NotNull Class<E> enumClass, @NotNull @NotNull String name) Get an enum constant with the given name if it exists.- Type Parameters:
E
- the enum type- Parameters:
enumClass
- the class of the enum from which to get a constantname
- the name of the constant. This name is case-insensitive- Returns:
- an
Optional
containing the constant, or an empty Optional if a constant with the given name did not exist
-