public KeyTreeNode update(String prefix) { KeyTreeNode root = new KeyTreeNode(value, isLeave, isDeleted, isArray); if (this.getAlterKey() != null) { root.setAlterKey(this.alterKey.updateKey(prefix)); } this.getChildren() .forEach( (key, childNode) -> { KeyTreeNode childRoot = childNode.update(prefix); root.getChildren().put(key, childRoot); }); return root; }
public void addChild(KeyTreeNode child) { children.put(child.getValue(), child); }