From 7f0f0d1bf9c33576ea5edf9c3a772ddc724a098c Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 20 Sep 2016 22:12:29 +0100 Subject: [PATCH] NodeItem: add all args constructor --- src/main/java/net/kemitix/node/NodeItem.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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. *