Enum Class ContextValue.Usage

java.lang.Object
java.lang.Enum<ContextValue.Usage>
io.github.syst3ms.skriptparser.registration.context.ContextValue.Usage
All Implemented Interfaces:
Serializable, Comparable<ContextValue.Usage>, Constable
Enclosing class:
ContextValue<C extends TriggerContext, T>

public static enum ContextValue.Usage extends Enum<ContextValue.Usage>
One can use context values in two different ways:
  • context-something - the value is used with the common prefix 'context'; or
  • something - the value is used alone as an expression.
The usage determines which of the two variants, or both, are applicable.
  • Enum Constant Details

  • Method Details

    • values

      public static ContextValue.Usage[] 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 ContextValue.Usage 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
    • isCorrect

      public boolean isCorrect(boolean alone)
      Checks if the usage of this context value corresponds to the actual used syntax.
      Parameters:
      alone - whether the context value was used alone
      Returns:
      whether or not the context value was used correctly