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.impl.schema.tree;
11 import com.google.common.base.Optional;
12 import java.util.Collection;
13 import org.opendaylight.yangtools.concepts.Identifiable;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
15 import org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType;
16 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
19 * Internal interface representing a modification action of a particular node.
20 * It is used by the validation code to allow for a read-only view of the
21 * modification tree as we should never modify that during validation.
23 abstract class NodeModification implements Identifiable<PathArgument> {
25 * Get the type of modification.
27 * @return Modification type.
29 abstract ModificationType getType();
32 * Get the original tree node to which the modification is to be applied.
34 * @return The original node, or {@link Optional#absent()} if the node is
37 abstract Optional<TreeNode> getOriginal();
40 * Get a read-only view of children nodes.
42 * @return Collection of all children nodes.
44 abstract Collection<? extends NodeModification> getChildren();