Merge "Startup arch - Add scm section to root pom."
[controller.git] / opendaylight / md-sal / sal-binding-api / src / main / java / org / opendaylight / controller / md / sal / binding / api / DataObjectModification.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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.
7  */
8 package org.opendaylight.controller.md.sal.binding.api;
9
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;
16
17 /**
18  * Modified Data Object.
19  *
20  * Represents modification of Data Object.
21  *
22  */
23 public interface DataObjectModification<T extends DataObject> extends Identifiable<PathArgument> {
24
25     enum ModificationType {
26         /**
27          *
28          * Child node (direct or indirect) was modified.
29          *
30          */
31         SUBTREE_MODIFIED,
32         /**
33          *
34          * Node was explicitly created / overwritten.
35          *
36          */
37         WRITE,
38         /**
39          *
40          * Node was deleted.
41          *
42          */
43         DELETE
44     }
45
46     @Override
47     PathArgument getIdentifier();
48
49     /**
50      * Returns type of modified object.
51      *
52      * @return type of modified object.
53      */
54     @Nonnull Class<T> getDataType();
55
56     /**
57      *
58      * Returns type of modification
59      *
60      * @return type Type of performed modification.
61      */
62     @Nonnull ModificationType getModificationType();
63
64     /**
65      * Returns after state of top level container.
66      *
67      * @param root Class representing data container
68      * @return State of object after modification. Null if subtree is not present.
69      */
70     @Nullable T getDataAfter();
71
72     /**
73      * Returns unmodifiable collection of modified direct children.
74      *
75      * @return unmodifiable collection of modified direct children.
76      */
77     @Nonnull Collection<DataObjectModification<? extends DataObject>> getModifiedChildren();
78
79
80 }