Class EnumUtils<E extends Enum<E>>

java.lang.Object
ch.njol.skript.util.EnumUtils<E>
Type Parameters:
E - Generic representing the Enum.

public final class EnumUtils<E extends Enum<E>> extends Object
A language utility class to be used for easily handling language values representing an Enum.
See Also:
  • Constructor Details

    • EnumUtils

      public EnumUtils(Class<E> enumClass, String languageNode)
  • Method Details

    • parse

      @Nullable public E parse(String input)
      This method attempts to match the string input against one of the string representations of the enumerators.
      Parameters:
      input - a string to attempt to match against one the enumerators.
      Returns:
      The enumerator matching the input, or null if no match could be made.
    • toString

      public String toString(E enumerator, int flags)
      This method returns the string representation of an enumerator.
      Parameters:
      enumerator - The enumerator to represent as a string.
      flags - not currently used
      Returns:
      A string representation of the enumerator.
    • getAllNames

      public String getAllNames()
      Returns:
      A comma-separated string containing a list of all names representing the enumerators. Note that some entries may represent the same enumerator.