Add a few 3.0.0 FIXMEs
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / spi / MutableTreeNode.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.data.api.schema.tree.spi;
9
10 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
12 import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode;
13
14 /**
15  * A mutable tree node. This is a transient view materialized from a pre-existing node. Modifications are isolated. Once
16  * this object is {@link #seal()}ed, any interactions with it will result in undefined behavior.
17  */
18 // FIXME: 3.0.0: Use @NonNullByDefault
19 public interface MutableTreeNode extends StoreTreeNode<TreeNode> {
20     /**
21      * Set the data component of the node.
22      *
23      * @param data New data component, may not be null.
24      */
25     // FIXME: 3.0.0: document NullPointerException being thrown
26     void setData(NormalizedNode<?, ?> data);
27
28     /**
29      * Set the new subtree version. This is typically invoked when the user
30      * has modified some of this node's children.
31      *
32      * @param subtreeVersion New subtree version.
33      */
34     // FIXME: 3.0.0: document NullPointerException being thrown
35     void setSubtreeVersion(Version subtreeVersion);
36
37     /**
38      * Add a new child node. This acts as add-or-replace operation, e.g. it
39      * succeeds even if a conflicting child is already present.
40      *
41      * @param child New child node.
42      */
43     // FIXME: 3.0.0: document NullPointerException being thrown
44     void addChild(TreeNode child);
45
46     /**
47      * Remove a child node. This acts as delete-or-nothing operation, e.g. it
48      * succeeds even if the corresponding child is not present.
49      *
50      * @param id Child identificator.
51      */
52     // FIXME: 3.0.0: document NullPointerException being thrown
53     void removeChild(PathArgument id);
54
55     /**
56      * Finish node modification and return a read-only view of this node. After
57      * this method is invoked, any further calls to this object's method result
58      * in undefined behavior.
59      *
60      * @return Read-only view of this node.
61      */
62     TreeNode seal();
63 }