Class EnumUtil

java.lang.Object
wtf.choco.veinminer.util.EnumUtil

public final class EnumUtil extends Object
A utility class to more easily operate with enums.
  • 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 constant
      name - 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