Make (Mutable)TreeNode a class
[yangtools.git] / data / yang-data-tree-ri / src / main / java / org / opendaylight / yangtools / yang / data / tree / impl / node / MutableTreeNode.java
index d8cd869391f03ace51fdd45911e5912633ece01b..709b6acfad1a1d79140a3de34039e41de2d3fdfe 100644 (file)
@@ -17,14 +17,14 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode;
  * A mutable tree node. This is a transient view materialized from a pre-existing node. Modifications are isolated. Once
  * this object is {@link #seal()}ed, any interactions with it will result in undefined behavior.
  */
-public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
+public abstract class MutableTreeNode implements StoreTreeNode<TreeNode> {
     /**
      * Set the data component of the node.
      *
      * @param data New data component, may not be null.
      * @throws NullPointerException if {@code data} is null
      */
-    void setData(NormalizedNode data);
+    public abstract void setData(NormalizedNode data);
 
     /**
      * Set the new subtree version. This is typically invoked when the user
@@ -33,7 +33,7 @@ public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
      * @param subtreeVersion New subtree version.
      * @throws NullPointerException if {@code subtreeVersion} is null
      */
-    void setSubtreeVersion(Version subtreeVersion);
+    public abstract void setSubtreeVersion(Version subtreeVersion);
 
     /**
      * Add a new child node. This acts as add-or-replace operation, e.g. it succeeds even if a conflicting child is
@@ -43,7 +43,7 @@ public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
      * @return Replaced child, or null if there was no previous child
      * @throws NullPointerException if {@code child} is null
      */
-    @Nullable TreeNode putChild(TreeNode child);
+    public abstract @Nullable TreeNode putChild(TreeNode child);
 
     /**
      * Remove a child node. This acts as delete-or-nothing operation, e.g. it succeeds even if the corresponding child
@@ -53,7 +53,7 @@ public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
      * @return Removed child, or null if there was no matching child
      * @throws NullPointerException if {@code id} is null
      */
-    @Nullable TreeNode removeChild(PathArgument id);
+    public abstract @Nullable TreeNode removeChild(PathArgument id);
 
     /**
      * Finish node modification and return a read-only view of this node. After
@@ -62,5 +62,5 @@ public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
      *
      * @return Read-only view of this node.
      */
-    @NonNull TreeNode seal();
+    public abstract @NonNull TreeNode seal();
 }