Common tree cache operations
Common Operations In the previous section, some of the most used operations, such as addition and retrieval, have been shown. However, there're other important operations that are worth mentioning, such as remove:  You can for example remove an entire node, i.e. /persons/john, using: treeCache.removeNode("/persons/john");  Or remove a child node, i.e. persons that a child of root, via: treeCache.getRoot().removeChild(Fqn.fromString("persons"));  You can also remove a particular key/value pair in a node: Node john = treeCache.getRoot().getChild(Fqn.fromElements("persons", "john")); john.remove("surname");  Or you can remove all data in a node with: Node john = treeCache.getRoot().getChild(Fqn.fromElements("persons", "john")); john.clearData();  Another important operation supported by Tree API is the ability to move nodes around in the tree. Imagine we have a node called 'john' which is located under root node. The following example is going to show how to we can move 'john' node to be under 'persons' node: /*   /persons   /john */  Node john = treeCache.getRoot().addChild(Fqn.fromString("john")); Node persons = treeCache.getRoot().getChild(Fqn.fromString("persons")); treeCache.move(john.getFqn(), persons.getFqn());  /*   /persons/john */