/** * Removes a node from the builder given its {@link Node#getName() name} * <p> * Since a canonical tree builder uses only the node names to arrange the nodes on the internal * tree structure, it is safe to overload {@link #remove(Node)} with a String argument version. * * @param featureId the name of the node to remove * @return {@code this} */ public final CanonicalTreeBuilder remove(final String featureId) { checkNotNull(featureId, "Argument featureId is null"); checkState(!disposed.get(), "TreeBuilder is already disposed"); Node removeNode = Node.create(featureId, ObjectId.NULL, ObjectId.NULL, TYPE.FEATURE, null); clusteringStrategy().remove(removeNode); return this; }
/** * Removes a node from the builder given its {@link Node#getName() name} * <p> * Since a canonical tree builder uses only the node names to arrange the nodes on the internal * tree structure, it is safe to overload {@link #remove(Node)} with a String argument version. * * @param featureId the name of the node to remove * @return {@code this} */ public final CanonicalTreeBuilder remove(final String featureId) { checkNotNull(featureId, "Argument featureId is null"); checkState(!disposed.get(), "TreeBuilder is already disposed"); Node removeNode = RevObjectFactory.defaultInstance().createNode(featureId, ObjectId.NULL, ObjectId.NULL, TYPE.FEATURE, null, null); clusteringStrategy().remove(removeNode); return this; }