Class Enums

java.lang.Object
com.sk89q.worldguard.util.Enums

public final class Enums extends Object
Helper methods for enums.
  • Method Details

    • findByValue

      @Nullable public static <T extends Enum<T>> T findByValue(Class<T> enumType, String... values)
      Search the given enum for a value that is equal to the one of the given values, searching in an ascending manner.
      Type Parameters:
      T - the type of enum
      Parameters:
      enumType - the enum type
      values - the list of values
      Returns:
      the found value or null
    • findFuzzyByValue

      @Nullable public static <T extends Enum<T>> T findFuzzyByValue(Class<T> enumType, String... values)
      Search the given enum for a value that is equal to the one of the given values, searching in an ascending manner.

      Some fuzzy matching of the provided values may be performed.

      Type Parameters:
      T - the type of enum
      Parameters:
      enumType - the enum type
      values - the list of values
      Returns:
      the found value or null