2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.data.api.schema.tree;
10 import javax.annotation.Nonnull;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
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.
19 public interface DataTreeModification extends DataTreeSnapshot {
21 * Delete the node at specified path.
23 * @param path Node path
25 void delete(YangInstanceIdentifier path);
28 * Merge the specified data with the currently-present data
31 * @param path Node path
32 * @param data Data to be merged
34 void merge(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
37 * Replace the data at specified path with supplied data.
39 * @param path Node path
40 * @param data New node data
42 void write(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
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.
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.
59 * @param cursor cursor to which this modification
61 void applyToCursor(@Nonnull DataTreeModificationCursor cursor);