public interface Node extends TreeItem
ConfigNode| Modifier and Type | Method and Description |
|---|---|
default TreeItem |
add(TreeItem item)
Attempts to introduce a new child to this node.
|
default Node |
fork(java.lang.String name)
Forks this node, creating a subtree whose parent is this node.
|
default Node |
fork(java.lang.String name,
boolean serializeSeparately)
Forks this node, creating a subtree whose parent is this node.
|
java.util.Set<TreeItem> |
getItems()
Returns a set of this node's children.
|
default boolean |
isSerializedSeparately()
Returns
true if this node should be serialized separately to its parent. |
default TreeItem |
lookup(java.lang.String name)
Tries to find a child in this node by name.
|
default TreeItem |
remove(java.lang.String name)
Attempts to remove an item from this node by name.
|
@Nonnull java.util.Set<TreeItem> getItems()
default boolean isSerializedSeparately()
true if this node should be serialized separately to its parent.
If a node is serialized separately, it should not appear in the serialized representation of its parent. This setting has no effect if this node is a root.
true if this node should be serialized separately, and false otherwise@Nullable default TreeItem lookup(java.lang.String name)
name - The name of the child to look fornulldefault TreeItem add(@Nonnull TreeItem item) throws FiberException
item - The child to addFiberException - if there was already a child by the same namePropertydefault TreeItem remove(java.lang.String name)
name - the name of the child that should be removednulldefault Node fork(java.lang.String name) throws FiberException
name - the name of the new NodeFiberException - if the new node cannot be added as a child to this nodedefault Node fork(java.lang.String name, boolean serializeSeparately) throws FiberException
name - the name of the new NodeserializeSeparately - if true, the subtree will not appear in the
serialized representation of this NodeFiberException - if the new node cannot be added as a child to this node