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 SummaryNested Classes
- 
Method SummaryModifier 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- 
ofCreate 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
 
- 
ofCreate a new node tree with the given values, and the specified root fallback value.- Parameters:
- values- The values to be contained in this node tree
- defaultValue- The fallback value for any completely undefined nodes
- Returns:
- The newly created node tree
 
- 
ofTristatesCreate 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
 
- 
ofTristatesCreate a new node tree with the given values, and the specified root fallback value.- Parameters:
- values- The values to be contained in this node tree
- defaultValue- The fallback value for any completely undefined nodes
- Returns:
- The newly created node tree
 
- 
getReturns the value assigned to a specific node, or the nearest parent value in the tree if the node itself is undefined.- Parameters:
- node- The path to get the node value at
- Returns:
- The tristate value for the given node
 
- 
rootValueTristate rootValue()Get the value of the root node in this tree.- Returns:
- the root node value
 
- 
withRootValueReturn a modified tree with the provided root node value.- Parameters:
- state- the new state for the root node
- Returns:
- a tree reflecting the changed state, leaving the receiver unmodified
 
- 
asMapConvert this node tree into a map of the defined nodes in this tree.- Returns:
- An immutable map representation of the nodes defined in this tree
 
- 
withValueReturn a new NodeTree instance with a single changed value.- Parameters:
- node- The node path to change the value of
- value- The value to change, or UNDEFINED to remove
- Returns:
- The new, modified node tree
 
- 
withAllReturn a modified new node tree with the specified values set.- Parameters:
- values- The values to set
- Returns:
- The new node tree
 
- 
withAllTristatesReturn a modified new node tree with the specified values set.- Parameters:
- values- The values to set
- Returns:
- The new node tree
 
 
-