Added getModifiedChild to DataTreeCandidateNode.
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / DataTreeCandidateNode.java
index 67c7533397cd39a05855cd2dd51b77eaee878892..4a8ced9be79421fcc04fa63418336f3cd82aa2c1 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.yangtools.yang.data.api.schema.tree;
 
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-
 import com.google.common.base.Optional;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 /**
  * A single node within a {@link DataTreeCandidate}. The nodes are organized
@@ -19,26 +20,36 @@ import com.google.common.base.Optional;
  * tree restricted to the modified nodes.
  */
 public interface DataTreeCandidateNode {
+
     /**
      * Get the node identifier.
      *
      * @return The node identifier.
      */
-    PathArgument getIdentifier();
+    @Nonnull PathArgument getIdentifier();
 
     /**
      * Get an unmodifiable iterable of modified child nodes.
      *
      * @return Unmodifiable iterable of modified child nodes.
      */
-    Iterable<DataTreeCandidateNode> getChildNodes();
+    @Nonnull Iterable<DataTreeCandidateNode> getChildNodes();
+
+    /**
+     * Returns modified child or null if child was not modified
+     * / does not exists.
+     *
+     * @param identifier Identifier of child node
+     * @return Modified child or null if child was not modified.
+     */
+    @Nullable DataTreeCandidateNode getModifiedChild(PathArgument identifier);
 
     /**
      * Return the type of modification this node is undergoing.
      *
      * @return Node modification type.
      */
-    ModificationType getModificationType();
+    @Nonnull ModificationType getModificationType();
 
     /**
      * Return the before-image of data corresponding to the node.