Remove StoreTreeNodes.getChild()
[yangtools.git] / data / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / DataTreeModification.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;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
13
14 /**
15  * Class encapsulation of set of modifications to a base tree. This tree is backed
16  * by a read-only snapshot and tracks modifications on top of that. The modification
17  * has the ability to rebase itself to a new snapshot.
18  */
19 public interface DataTreeModification extends DataTreeSnapshot {
20     /**
21      * Delete the node at specified path.
22      *
23      * @param path Node path
24      */
25     void delete(YangInstanceIdentifier path);
26
27     /**
28      * Merge the specified data with the currently-present data
29      * at specified path.
30      *
31      * @param path Node path
32      * @param data Data to be merged
33      */
34     void merge(YangInstanceIdentifier path, NormalizedNode data);
35
36     /**
37      * Replace the data at specified path with supplied data.
38      *
39      * @param path Node path
40      * @param data New node data
41      */
42     void write(YangInstanceIdentifier path, NormalizedNode data);
43
44     /**
45      * Finish creation of a modification, making it ready for application
46      * to the data tree. Any calls to this object's methods except
47      * {@link #applyToCursor(DataTreeModificationCursor)} will result
48      * in undefined behavior, possibly with an
49      * {@link IllegalStateException} being thrown.
50      */
51     void ready();
52
53     /**
54      * Apply the contents of this modification to a cursor. This can be used
55      * to replicate this modification onto another one. The cursor's position
56      * must match the root of this modification, otherwise performing this
57      * operation will result in undefined behavior.
58      *
59      * @param cursor cursor to which this modification
60      */
61     void applyToCursor(@NonNull DataTreeModificationCursor cursor);
62 }