public 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.
| Modifier and Type | Method and Description |
|---|---|
@NonNull DataMutateResult |
add(@NonNull Node node)
Adds a node.
|
DataMutateResult.WithMergedNode |
add(@NonNull Node node,
@NonNull TemporaryNodeMergeStrategy temporaryNodeMergeStrategy)
Adds a node.
|
void |
clear()
Clears all nodes.
|
void |
clear(@NonNull ContextSet contextSet)
Clears all nodes in a specific context.
|
void |
clear(@NonNull ContextSet contextSet,
@NonNull Predicate<? super Node> test)
Clears all nodes in a specific context which pass the predicate.
|
void |
clear(@NonNull Predicate<? super Node> test)
Clears any nodes which pass the predicate.
|
@NonNull Tristate |
contains(@NonNull Node node,
@NonNull NodeEqualityPredicate equalityPredicate)
Gets if this instance contains a given
Node. |
@NonNull DataMutateResult |
remove(@NonNull Node node)
Removes a node.
|
@NonNull Collection<Node> |
toCollection()
Gets a flattened view of
Nodes contained within this instance. |
@NonNull Map<ImmutableContextSet,Collection<Node>> |
toMap()
|
@NonNull Map<ImmutableContextSet,Collection<Node>> toMap()
@NonNull Collection<Node> toCollection()
Nodes contained within this instance.
Effectively combines the value collections of the map returned by
toMap().
@NonNull Tristate contains(@NonNull Node node, @NonNull NodeEqualityPredicate equalityPredicate)
Node.
Returns Tristate.UNDEFINED if the instance does not contain the node,
and the assigned value of the node as a Tristate
if it is present.
node - the node to check forequalityPredicate - how to determine if a node matchesNullPointerException - if the node is null@NonNull DataMutateResult add(@NonNull Node node)
node - the node to be addDataMutateResult.WithMergedNode add(@NonNull Node node, @NonNull TemporaryNodeMergeStrategy temporaryNodeMergeStrategy)
node - the node to addtemporaryNodeMergeStrategy - the strategy used to merge temporary permission entries@NonNull DataMutateResult remove(@NonNull Node node)
node - the node to removevoid clear()
void clear(@NonNull Predicate<? super Node> test)
test - the predicate to test for nodes which should be removedvoid clear(@NonNull ContextSet contextSet)
contextSet - the contexts to filter byvoid clear(@NonNull ContextSet contextSet, @NonNull Predicate<? super Node> test)
contextSet - the contexts to filter bytest - the predicate to test for nodes which should be removed