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 com.google.common.base.Optional;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 * A single node within a {@link DataTreeCandidate}. The nodes are organized
18 * in tree hierarchy, reflecting the modification from which this candidate
19 * was created. The node itself exposes the before- and after-image of the
20 * tree restricted to the modified nodes.
22 public interface DataTreeCandidateNode {
25 * Get the node identifier.
27 * @return The node identifier.
29 @Nonnull PathArgument getIdentifier();
32 * Get an unmodifiable iterable of modified child nodes.
34 * @return Unmodifiable iterable of modified child nodes.
36 @Nonnull Iterable<DataTreeCandidateNode> getChildNodes();
39 * Returns modified child or null if child was not modified
42 * @param identifier Identifier of child node
43 * @return Modified child or null if child was not modified.
45 @Nullable DataTreeCandidateNode getModifiedChild(PathArgument identifier);
48 * Return the type of modification this node is undergoing.
50 * @return Node modification type.
52 @Nonnull ModificationType getModificationType();
55 * Return the before-image of data corresponding to the node.
57 * @return Node data as they were present in the tree before
58 * the modification was applied.
60 Optional<NormalizedNode<?, ?>> getDataAfter();
63 * Return the after-image of data corresponding to the node.
65 * @return Node data as they will be present in the tree after
66 * the modification is applied.
68 Optional<NormalizedNode<?, ?>> getDataBefore();