NodeItem: add all args constructor
This commit is contained in:
parent
22518df8b9
commit
7f0f0d1bf9
1 changed files with 17 additions and 0 deletions
|
@ -50,6 +50,23 @@ class NodeItem<T> implements Node<T> {
|
|||
|
||||
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<T> parent, @NonNull final Set<Node<T>> children
|
||||
) {
|
||||
this.data = data;
|
||||
this.name = name;
|
||||
this.parent = parent;
|
||||
this.children.addAll(children);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create named root node.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue