Enum Class ShorthandParser

java.lang.Object
java.lang.Enum<ShorthandParser>
me.lucko.luckperms.common.node.utils.ShorthandParser
All Implemented Interfaces:
Serializable, Comparable<ShorthandParser>, Constable

public enum ShorthandParser extends Enum<ShorthandParser>
Utility to expand shorthand nodes
  • Enum Constant Details

    • NUMERIC_RANGE

      public static final ShorthandParser NUMERIC_RANGE
      Expands "1-4" to ["1", "2", "3", "4"]
    • CHARACTER_RANGE

      public static final ShorthandParser CHARACTER_RANGE
      Expands "a-d" to ["a", "b", "c", "d"]
    • LIST

      public static final ShorthandParser LIST
      Expands "aa,bb|cc" to ["aa", "bb", "cc"]
  • Method Details

    • values

      public static ShorthandParser[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ShorthandParser valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • expandShorthand

      public static Set<String> expandShorthand(String s)
      Parses and expands the shorthand format.
      Parameters:
      s - the string to expand
      Returns:
      the expanded result