Package dev.polv.taleapi.permission
Class ContextSet.Builder
java.lang.Object
dev.polv.taleapi.permission.ContextSet.Builder
- Enclosing class:
- ContextSet
Builder for creating ContextSet instances.
-
Method Summary
Modifier and TypeMethodDescriptionadd(ContextKey<T> key, T value) Adds a context key-value pair.Adds a raw string key-value pair.addAll(ContextSet other) Adds all contexts from another ContextSet.build()Builds the immutable ContextSet.
-
Method Details
-
add
Adds a context key-value pair.- Type Parameters:
T- the value type- Parameters:
key- the context keyvalue- the context value- Returns:
- this builder for chaining
-
add
Adds a raw string key-value pair.Prefer using typed
ContextKeywhen possible.- Parameters:
key- the context key namevalue- the context value- Returns:
- this builder for chaining
-
addAll
Adds all contexts from another ContextSet.- Parameters:
other- the context set to copy from- Returns:
- this builder for chaining
-
build
Builds the immutable ContextSet.- Returns:
- a new ContextSet
-