Interface NodeTree
public interface NodeTree
An immutable tree structure for determining node data. Any changes will
create new copies of the necessary tree objects.
This class is simply provided as a utility for plugins implementing
PermissionService. It is not a requirement that this class is used,
however the behaviour defined in Subject regarding implicit node
inheritance should be maintained.
- Keys are case-insensitive.
- Segments of nodes are split by the '.' character
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionasMap()Convert this node tree into a map of the defined nodes in this tree.Returns the value assigned to a specific node, or the nearest parent value in the tree if the node itself is undefined.static NodeTreeCreate a new node tree with the given values, and a default value ofTristate.UNDEFINED.static NodeTreeCreate a new node tree with the given values, and the specified root fallback value.static NodeTreeofTristates(Map<String, Tristate> values) Create a new node tree with the given values, and a default value ofTristate.UNDEFINED.static NodeTreeofTristates(Map<String, Tristate> values, Tristate defaultValue) Create a new node tree with the given values, and the specified root fallback value.Get the value of the root node in this tree.Return a modified new node tree with the specified values set.withAllTristates(Map<String, Tristate> values) Return a modified new node tree with the specified values set.withRootValue(Tristate state) Return a modified tree with the provided root node value.Return a new NodeTree instance with a single changed value.
-
Method Details
-
of
Create a new node tree with the given values, and a default value ofTristate.UNDEFINED.- Parameters:
values- The values to set- Returns:
- The new node tree
-
of
Create a new node tree with the given values, and the specified root fallback value.- Parameters:
values- The values to be contained in this node treedefaultValue- The fallback value for any completely undefined nodes- Returns:
- The newly created node tree
-
ofTristates
Create a new node tree with the given values, and a default value ofTristate.UNDEFINED.- Parameters:
values- The values to set- Returns:
- The new node tree
-
ofTristates
Create a new node tree with the given values, and the specified root fallback value.- Parameters:
values- The values to be contained in this node treedefaultValue- The fallback value for any completely undefined nodes- Returns:
- The newly created node tree
-
get
-
rootValue
-
withRootValue
-
asMap
-
withValue
-
withAll
-
withAllTristates
-