Interface MutableTreeNode
-
- All Superinterfaces:
StoreTreeNode<TreeNode>
public interface MutableTreeNode extends StoreTreeNode<TreeNode>
A mutable tree node. This is a transient view materialized from a pre-existing node. Modifications are isolated. Once this object isseal()
ed, any interactions with it will result in undefined behavior.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @Nullable TreeNode
putChild(TreeNode child)
Add a new child node.@Nullable TreeNode
removeChild(YangInstanceIdentifier.PathArgument id)
Remove a child node.@NonNull TreeNode
seal()
Finish node modification and return a read-only view of this node.void
setData(NormalizedNode data)
Set the data component of the node.void
setSubtreeVersion(Version subtreeVersion)
Set the new subtree version.-
Methods inherited from interface org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode
childByArg, findChildByArg, getChildByArg
-
-
-
-
Method Detail
-
setData
void setData(NormalizedNode data)
Set the data component of the node.- Parameters:
data
- New data component, may not be null.- Throws:
NullPointerException
- ifdata
is null
-
setSubtreeVersion
void setSubtreeVersion(Version subtreeVersion)
Set the new subtree version. This is typically invoked when the user has modified some of this node's children.- Parameters:
subtreeVersion
- New subtree version.- Throws:
NullPointerException
- ifsubtreeVersion
is null
-
putChild
@Nullable TreeNode putChild(TreeNode child)
Add a new child node. This acts as add-or-replace operation, e.g. it succeeds even if a conflicting child is already present.- Parameters:
child
- New child node.- Returns:
- Replaced child, or null if there was no previous child
- Throws:
NullPointerException
- ifchild
is null
-
removeChild
@Nullable TreeNode removeChild(YangInstanceIdentifier.PathArgument id)
Remove a child node. This acts as delete-or-nothing operation, e.g. it succeeds even if the corresponding child is not present.- Parameters:
id
- Child identifier.- Returns:
- Removed child, or null if there was no matching child
- Throws:
NullPointerException
- ifid
is null
-
seal
@NonNull TreeNode seal()
Finish node modification and return a read-only view of this node. After this method is invoked, any further calls to this object's method result in undefined behavior.- Returns:
- Read-only view of this node.
-
-