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 org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
13 import com.google.common.base.Optional;
16 * A single node within a {@link DataTreeCandidate}. The nodes are organized
17 * in tree hierarchy, reflecting the modification from which this candidate
18 * was created. The node itself exposes the before- and after-image of the
19 * tree restricted to the modified nodes.
21 public interface DataTreeCandidateNode {
23 * Get the node identifier.
25 * @return The node identifier.
27 PathArgument getIdentifier();
30 * Get an unmodifiable iterable of modified child nodes.
32 * @return Unmodifiable iterable of modified child nodes.
34 Iterable<DataTreeCandidateNode> getChildNodes();
37 * Return the type of modification this node is undergoing.
39 * @return Node modification type.
41 ModificationType getModificationType();
44 * Return the before-image of data corresponding to the node.
46 * @return Node data as they were present in the tree before
47 * the modification was applied.
49 Optional<NormalizedNode<?, ?>> getDataAfter();
52 * Return the after-image of data corresponding to the node.
54 * @return Node data as they will be present in the tree after
55 * the modification is applied.
57 Optional<NormalizedNode<?, ?>> getDataBefore();