Interface NodeMap
Nodes) within a PermissionHolder.
The effect of any mutate operation will not persist in storage unless changes are
explicitly saved. If changes are not saved, the effect will only be observed until the next
time the holders permission data is (re)loaded. Changes to Users should be saved
using UserManager.saveUser(User), and changes to Groups should be saved
using GroupManager.saveGroup(Group).
Before making changes to a user or group, it may be a good idea to load a fresh copy of
the backing data from the storage if you haven't done so already, to avoid overwriting changes
made already. This can be done via UserManager.loadUser(UUID) or
GroupManager.loadGroup(String) respectively.
-
Method Summary
Modifier and TypeMethodDescriptionAdds a node.add(@NonNull Node node, @NonNull TemporaryNodeMergeStrategy temporaryNodeMergeStrategy) Adds a node.voidclear()Clears all nodes.voidClears any nodes which pass the predicate.voidclear(@NonNull ContextSet contextSet) Clears all nodes in a specific context.voidClears all nodes in a specific context which pass the predicate.contains(@NonNull Node node, @NonNull NodeEqualityPredicate equalityPredicate) Gets if this instance contains a givenNode.Removes a node.Gets a flattened view ofNodes contained within this instance.toMap()
-
Method Details
-
toMap
@NonNull @Unmodifiable Map<ImmutableContextSet,Collection<Node>> toMap()- Returns:
- a map of nodes
-
toCollection
@NonNull @Unmodifiable Collection<Node> toCollection()Gets a flattened view ofNodes contained within this instance.Effectively combines the value collections of the map returned by
toMap().- Returns:
- a flattened collection of nodes
-
contains
Gets if this instance contains a givenNode.Returns
Tristate.UNDEFINEDif the instance does not contain the node, and theassigned valueof the node as aTristateif it is present.- Parameters:
node- the node to check forequalityPredicate- how to determine if a node matches- Returns:
- a Tristate relating to the assigned state of the node
- Throws:
NullPointerException- if the node is null
-
add
Adds a node.- Parameters:
node- the node to be add- Returns:
- the result of the operation
-
add
@NonNull DataMutateResult.WithMergedNode add(@NonNull Node node, @NonNull TemporaryNodeMergeStrategy temporaryNodeMergeStrategy) Adds a node.- Parameters:
node- the node to addtemporaryNodeMergeStrategy- the strategy used to merge temporary permission entries- Returns:
- the result of the operation
-
remove
Removes a node.- Parameters:
node- the node to remove- Returns:
- the result of the operation
-
clear
void clear()Clears all nodes. -
clear
Clears any nodes which pass the predicate.- Parameters:
test- the predicate to test for nodes which should be removed
-
clear
Clears all nodes in a specific context.- Parameters:
contextSet- the contexts to filter by
-
clear
Clears all nodes in a specific context which pass the predicate.- Parameters:
contextSet- the contexts to filter bytest- the predicate to test for nodes which should be removed
-