Merge "BUG-994: Use SchemaPath.getParent()"
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / spi / TreeNode.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
11 import org.opendaylight.yangtools.concepts.Identifiable;
12 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode;
15
16 /**
17  * A very basic data tree node. It has a version (when it was last modified),
18  * a subtree version (when any of its children were modified) and some read-only
19  * data.
20  */
21 public interface TreeNode extends Identifiable<PathArgument>, StoreTreeNode<TreeNode> {
22     /**
23      * Get the data node version.
24      *
25      * @return Current data node version.
26      */
27     Version getVersion();
28
29     /**
30      * Get the subtree version.
31      *
32      * @return Current subtree version.
33      */
34     Version getSubtreeVersion();
35
36     /**
37      * Get a read-only view of the underlying data.
38      *
39      * @return Unmodifiable view of the underlying data.
40      */
41     NormalizedNode<?, ?> getData();
42
43     /**
44      * Get a mutable, isolated copy of the node.
45      *
46      * @return Mutable copy
47      */
48     MutableTreeNode mutable();
49 }