Package net.luckperms.api.context
Interface Context
-
public interface ContextRepresents an individual context pair.Context keys and values may not be null or empty. A key/value will be deemed empty if it's length is zero, or if it consists of only space characters.
- See Also:
ContextSet
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description @NonNull StringgetKey()Gets the context key.@NonNull StringgetValue()Gets the context valuestatic booleanisValidKey(@Nullable String key)Tests whetherkeyis valid.static booleanisValidValue(@Nullable String value)Tests whethervalueis valid.
-
-
-
Method Detail
-
isValidKey
static boolean isValidKey(@Nullable String key)
Tests whetherkeyis valid.Context keys and values may not be null or empty. A key/value will be deemed empty if it's length is zero, or if it consists of only space characters.
An exception is thrown when an invalid key is added to a
ContextSet.- Parameters:
key- the key to test- Returns:
- true if valid, false otherwise.
- Since:
- 5.1
-
isValidValue
static boolean isValidValue(@Nullable String value)
Tests whethervalueis valid.Context keys and values may not be null or empty. A key/value will be deemed empty if it's length is zero, or if it consists of only space characters.
An exception is thrown when an invalid value is added to a
ContextSet.- Parameters:
value- the value to test- Returns:
- true if valid, false otherwise.
- Since:
- 5.1
-
-