Package dev.polv.taleapi.permission
Class ContextKey<T>
java.lang.Object
dev.polv.taleapi.permission.ContextKey<T>
- Type Parameters:
T- the type of value this key holds
Represents a context key used in permission context matching.
Context keys are typed identifiers for context values. Common built-in keys include:
world- The world name (e.g., "nether", "overworld")server- The server name in a networkgamemode- The player's gamemode
Example
ContextKey<String> WORLD = ContextKey.of("world", String.class);
ContextKey<String> GAMEMODE = ContextKey.of("gamemode", String.class);
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextKey<String>Context key for the player's gamemode.static final ContextKey<String>Context key for the server name in a network.static final ContextKey<String>Context key for the world name (e.g., "nether", "overworld"). -
Method Summary
-
Field Details
-
WORLD
Context key for the world name (e.g., "nether", "overworld"). -
SERVER
Context key for the server name in a network. -
GAMEMODE
Context key for the player's gamemode.
-
-
Method Details
-
of
Creates a new context key.- Type Parameters:
T- the value type- Parameters:
key- the string identifier for this keytype- the class type of values for this key- Returns:
- a new ContextKey instance
-
key
Returns the string identifier for this key.- Returns:
- the key name
-
type
Returns the type of values this key holds.- Returns:
- the value class type
-
equals
-
hashCode
public int hashCode() -
toString
-