X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fbinding%2Fapi%2FDataObjectModification.java;h=678ac34e39d25d54fc12316fc17df1d51c5ed28f;hp=2eee0e8099923993e7ca57dfd89747a103c4cd0e;hb=98b2fe4c9d3c3f2a6d4fa2d0c3f17e237d15082e;hpb=cccc148d3cd2b5a2a7c86da2e74f2ea43fa00b93 diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/md/sal/binding/api/DataObjectModification.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/md/sal/binding/api/DataObjectModification.java index 2eee0e8099..678ac34e39 100644 --- a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/md/sal/binding/api/DataObjectModification.java +++ b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/md/sal/binding/api/DataObjectModification.java @@ -10,8 +10,11 @@ package org.opendaylight.controller.md.sal.binding.api; import java.util.Collection; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.opendaylight.yangtools.concepts.Identifiable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.ChildOf; import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.binding.Identifier; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; /** @@ -20,7 +23,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; * Represents modification of Data Object. * */ -public interface DataObjectModification extends Identifiable { +public interface DataObjectModification extends org.opendaylight.yangtools.concepts.Identifiable { enum ModificationType { /** @@ -76,5 +79,56 @@ public interface DataObjectModification extends Identifiab */ @Nonnull Collection> getModifiedChildren(); + /** + * Returns container child modification if {@code child} was modified by this + * modification. + * + * For accessing all modified list items consider iterating over {@link #getModifiedChildren()}. + * + * @param child Type of child - must be only container + * @return Modification of {@code child} if {@code child} was modified, null otherwise. + * @throws IllegalArgumentException If supplied {@code child} class is not valid child according + * to generated model. + */ + @Nullable > DataObjectModification getModifiedChildContainer(@Nonnull Class child); + + /** + * Returns augmentation child modification if {@code augmentation} was modified by this + * modification. + * + * For accessing all modified list items consider iterating over {@link #getModifiedChildren()}. + * + * @param augmentation Type of augmentation - must be only container + * @return Modification of {@code augmentation} if {@code augmentation} was modified, null otherwise. + * @throws IllegalArgumentException If supplied {@code augmentation} class is not valid augmentation + * according to generated model. + */ + @Nullable & DataObject> DataObjectModification getModifiedAugmentation(@Nonnull Class augmentation); + + + /** + * Returns child list item modification if {@code child} was modified by this modification. + * + * @param listItem Type of list item - must be list item with key + * @param listKey List item key + * @return Modification of {@code child} if {@code child} was modified, null otherwise. + * @throws IllegalArgumentException If supplied {@code listItem} class is not valid child according + * to generated model. + */ + & ChildOf, K extends Identifier> DataObjectModification getModifiedChildListItem( + @Nonnull Class listItem,@Nonnull K listKey); + + /** + * Returns a child modification if a node identified by {@code childArgument} was modified by + * this modification. + * + * @param childArgument Path Argument of child node + * @return Modification of child identified by {@code childArgument} if {@code childArgument} + * was modified, null otherwise. + * @throws IllegalArgumentException If supplied path argument is not valid child according to + * generated model. + * + */ + @Nullable DataObjectModification getModifiedChild(PathArgument childArgument); }