diff --git a/src/main/java/net/kemitix/node/ImmutableNodeItem.java b/src/main/java/net/kemitix/node/ImmutableNodeItem.java index 020cdb9..009d2af 100644 --- a/src/main/java/net/kemitix/node/ImmutableNodeItem.java +++ b/src/main/java/net/kemitix/node/ImmutableNodeItem.java @@ -49,12 +49,33 @@ final class ImmutableNodeItem extends AbstractNodeItem { super(data, name, parent, children); } + /** + * Creates a new immutable root node. + * + * @param data the data of the node + * @param name the name of the node + * @param children the children of the node + * @param the type of the data in the node + * + * @return the new node tree's root node + */ static ImmutableNodeItem newRoot( final T data, final String name, final Set> children ) { return new ImmutableNodeItem<>(data, name, null, children); } + /** + * Creates a new immutable subtree from this child. + * + * @param data the data of the node + * @param name the name of the node + * @param parent the mutable parent of the node + * @param children the children of the node + * @param the type of the data in the node + * + * @return the new immutable node + */ static ImmutableNodeItem newChild( final T data, final String name, final Node parent, final Set> children ) {