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 java.util.Collection;
11 import java.util.Optional;
12 import javax.annotation.Nonnull;
13 import javax.annotation.Nullable;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
18 * A single node within a {@link DataTreeCandidate}. The nodes are organized
19 * in tree hierarchy, reflecting the modification from which this candidate
20 * was created. The node itself exposes the before- and after-image of the
21 * tree restricted to the modified nodes.
23 public interface DataTreeCandidateNode {
26 * Get the node identifier.
28 * @return The node identifier.
30 @Nonnull PathArgument getIdentifier();
33 * Get an unmodifiable collection of modified child nodes.
35 * @return Unmodifiable collection of modified child nodes.
37 @Nonnull Collection<DataTreeCandidateNode> getChildNodes();
40 * Returns modified child or null if child was not modified
43 * @param childIdentifier Identifier of child node
44 * @return Modified child or null if child was not modified.
46 @Nullable DataTreeCandidateNode getModifiedChild(PathArgument childIdentifier);
49 * Return the type of modification this node is undergoing.
51 * @return Node modification type.
53 @Nonnull ModificationType getModificationType();
56 * Return the after-image of data corresponding to the node.
58 * @return Node data as they will be present in the tree after
59 * the modification is applied.
61 @Nonnull Optional<NormalizedNode<?, ?>> getDataAfter();
64 * Return the before-image of data corresponding to the node.
66 * @return Node data as they were present in the tree before
67 * the modification was applied.
69 @Nonnull Optional<NormalizedNode<?, ?>> getDataBefore();