Package net.luckperms.api.context
Interface MutableContextSet
-
- All Superinterfaces:
ContextSet,Iterable<Context>
public interface MutableContextSet extends ContextSet
A mutable implementation ofContextSet.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidadd(@NonNull String key, @NonNull String value)Adds a context to this set.default voidadd(@NonNull Context entry)Adds a context to this set.default voidaddAll(@NonNull Iterable<Context> iterable)Adds the contexts contained in the givenIterableto this set.voidaddAll(@NonNull ContextSet contextSet)Adds of of the contexts in anotherContextSetto this set.voidclear()Removes all contexts from the set.static @NonNull MutableContextSetcreate()Creates a new empty MutableContextSet.static @NonNull MutableContextSetof(@NonNull String key, @NonNull String value)Creates aMutableContextSetfrom a context pair.voidremove(@NonNull String key, @NonNull String value)Removes a context from this set.voidremoveAll(@NonNull String key)Removes all contexts from this set with the given key.-
Methods inherited from interface net.luckperms.api.context.ContextSet
contains, contains, containsAny, containsKey, getAnyValue, getValues, immutableCopy, isEmpty, isImmutable, isSatisfiedBy, isSatisfiedBy, iterator, mutableCopy, size, toFlattenedMap, toMap, toSet
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
create
static @NonNull MutableContextSet create()
Creates a new empty MutableContextSet.- Returns:
- a new MutableContextSet
-
of
static @NonNull MutableContextSet of(@NonNull String key, @NonNull String value)
Creates aMutableContextSetfrom a context pair.- Parameters:
key- the keyvalue- the value- Returns:
- a new MutableContextSet containing one context pair
- Throws:
NullPointerException- if key or value is null
-
add
void add(@NonNull String key, @NonNull String value)
Adds a context to this set.- Parameters:
key- the key to addvalue- the value to add- Throws:
NullPointerException- if the key or value is null
-
add
default void add(@NonNull Context entry)
Adds a context to this set.- Parameters:
entry- the entry to add- Throws:
NullPointerException- if the entry is null
-
addAll
default void addAll(@NonNull Iterable<Context> iterable)
Adds the contexts contained in the givenIterableto this set.- Parameters:
iterable- an iterable of key value context pairs- Throws:
NullPointerException- if iterable is null
-
addAll
void addAll(@NonNull ContextSet contextSet)
Adds of of the contexts in anotherContextSetto this set.- Parameters:
contextSet- the set to add from- Throws:
NullPointerException- if the contextSet is null
-
remove
void remove(@NonNull String key, @NonNull String value)
Removes a context from this set.- Parameters:
key- the key to removevalue- the value to remove- Throws:
NullPointerException- if the key or value is null
-
removeAll
void removeAll(@NonNull String key)
Removes all contexts from this set with the given key.- Parameters:
key- the key to remove- Throws:
NullPointerException- if the key is null
-
clear
void clear()
Removes all contexts from the set.
-
-