2 * Copyright (c) 2015 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.controller.md.sal.binding.api;
10 import java.util.Collection;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.yangtools.concepts.Identifiable;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
18 * Modified Data Object.
20 * Represents modification of Data Object.
23 public interface DataObjectModification<T extends DataObject> extends Identifiable<PathArgument> {
25 enum ModificationType {
28 * Child node (direct or indirect) was modified.
34 * Node was explicitly created / overwritten.
47 PathArgument getIdentifier();
50 * Returns type of modified object.
52 * @return type of modified object.
54 @Nonnull Class<T> getDataType();
58 * Returns type of modification
60 * @return type Type of performed modification.
62 @Nonnull ModificationType getModificationType();
65 * Returns after state of top level container.
67 * @param root Class representing data container
68 * @return State of object after modification. Null if subtree is not present.
70 @Nullable T getDataAfter();
73 * Returns unmodifiable collection of modified direct children.
75 * @return unmodifiable collection of modified direct children.
77 @Nonnull Collection<DataObjectModification<? extends DataObject>> getModifiedChildren();