Package net.luckperms.api.context
Interface MutableContextSet
- All Superinterfaces:
ContextSet,Iterable<Context>
A mutable implementation of
ContextSet.-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a context to this set.default voidAdds a context to this set.default voidAdds the contexts contained in the givenIterableto this set.voidaddAll(@NonNull ContextSet contextSet) Adds all the contexts in anotherContextSetto this set.voidclear()Removes all contexts from the set.static @NonNull MutableContextSetcreate()Creates a new empty MutableContextSet.static @NonNull MutableContextSetCreates aMutableContextSetfrom a context pair.voidRemoves a context from this set.voidRemoves 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, toSetMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
create
Creates a new empty MutableContextSet.- Returns:
- a new MutableContextSet
-
of
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
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
Adds a context to this set.- Parameters:
entry- the entry to add- Throws:
NullPointerException- if the entry is null
-
addAll
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
Adds all the contexts in anotherContextSetto this set.- Parameters:
contextSet- the set to add from- Throws:
NullPointerException- if the contextSet is null
-
remove
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
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.
-