Merge "Bug:1238 - Revert changes to SshClientAdapter."
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / tree / data / NodeModification.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.controller.md.sal.dom.store.impl.tree.data;
9
10 import org.opendaylight.controller.md.sal.dom.store.impl.tree.ModificationType;
11 import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.TreeNode;
12 import org.opendaylight.yangtools.concepts.Identifiable;
13 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
14
15 import com.google.common.base.Optional;
16
17 /**
18  * Internal interface representing a modification action of a particular node.
19  * It is used by the validation code to allow for a read-only view of the
20  * modification tree as we should never modify that during validation.
21  */
22 interface NodeModification extends Identifiable<PathArgument> {
23     /**
24      * Get the type of modification.
25      *
26      * @return Modification type.
27      */
28     ModificationType getType();
29
30     /**
31      * Get the original tree node to which the modification is to be applied.
32      *
33      * @return The original node, or {@link Optional#absent()} if the node is
34      *         a new node.
35      */
36     Optional<TreeNode> getOriginal();
37
38     /**
39      * Get a read-only view of children nodes.
40      *
41      * @return Iterable of all children nodes.
42      */
43     Iterable<? extends NodeModification> getChildren();
44 }