public class NodeOperations
extends java.lang.Object
| Constructor and Description |
|---|
NodeOperations() |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
copyValue(Property<T> from,
Property<T> to) |
static void |
moveChildren(ConfigTree from,
ConfigTree to)
Merges two
ConfigTrees. |
static void |
moveNode(ConfigNode value,
ConfigTree to)
Moves a node (
ConfigNode) to a new parent ConfigTree. |
public static void moveChildren(ConfigTree from, ConfigTree to)
ConfigTrees.
The first parameter from will be stripped of its children,
and to will receive all of from's children.
If both nodes have one or more children with the same name, the child from from takes priority.
from - The ConfigNode that will be read from, but not mutated.to - The mutated ConfigBranch that will inherit from's values and nodes.public static void moveNode(ConfigNode value, ConfigTree to)
ConfigNode) to a new parent ConfigTree.
If the moved node has an existing parent, it will be detached. If the new parent has an existing node with the same name, it will be overwritten.
value - The leaf node to be inheritedto - The mutated ConfigBranch that will inherit value