diff --git a/src/main/java/net/kemitix/node/NodeItem.java b/src/main/java/net/kemitix/node/NodeItem.java index 0e92dfb..c3d87f7 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -50,6 +50,23 @@ class NodeItem implements Node { private String name; + /** + * Constructor. + * + * @param data the data of the node + * @param name the name of the node + * @param parent the parent of the node, or null for a root node + * @param children the children of the node - must not be null + */ + NodeItem( + final T data, final String name, final Node parent, @NonNull final Set> children + ) { + this.data = data; + this.name = name; + this.parent = parent; + this.children.addAll(children); + } + /** * Create named root node. *