Class ContextValue<V>
- java.lang.Object
-
- ca.stellardrift.permissionsex.context.ContextValue<V>
-
- Type Parameters:
V- value type
- All Implemented Interfaces:
net.kyori.adventure.text.ComponentLike
public final class ContextValue<V> extends Object implements net.kyori.adventure.text.ComponentLike
A (key, value) pair for one specific context entry.This value holds both raw and parsed context values.
-
-
Constructor Summary
Constructors Constructor Description ContextValue(String key, String rawValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull net.kyori.adventure.text.ComponentasComponent()@Nullable ContextDefinition<V>definition()booleanequals(@Nullable Object other)VgetParsedValue(ContextDefinition<V> definition)VgetParsedValue(ContextDefinitionProvider provider)inthashCode()Stringkey()Get the key used to resolve a context value.@Nullable VparsedValue()StringrawValue()The raw value, before being deserialized by a context definition.StringtoString()booleantryResolve(ContextDefinitionProvider provider)
-
-
-
Constructor Detail
-
ContextValue
public ContextValue(String key, String rawValue)
-
-
Method Detail
-
rawValue
public String rawValue()
The raw value, before being deserialized by a context definition.- Returns:
- raw value, as provided by the user
-
definition
public @Nullable ContextDefinition<V> definition()
-
parsedValue
public @Nullable V parsedValue()
-
tryResolve
public boolean tryResolve(ContextDefinitionProvider provider)
-
getParsedValue
public V getParsedValue(ContextDefinition<V> definition)
-
getParsedValue
public V getParsedValue(ContextDefinitionProvider provider)
-
asComponent
public @NonNull net.kyori.adventure.text.Component asComponent()
- Specified by:
asComponentin interfacenet.kyori.adventure.text.ComponentLike
-
-