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>
One can use context values in two different ways:
context-something- the value is used with the common prefix 'context'; orsomething- the value is used alone as an expression.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleanisCorrect(boolean alone) Checks if the usage of this context value corresponds to the actual used syntax.static ContextValue.UsageReturns the enum constant of this class with the specified name.static ContextValue.Usage[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EXPRESSION_ONLY
-
ALONE_ONLY
-
EXPRESSION_OR_ALONE
-
-
Method Details
-
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
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 nameNullPointerException- 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
-