Move NormalizedNode builders
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / OrderedNodeContainer.java
index 4516d77c7234d421179e2aea4d10175705f4cd71..48b3fbf8c4f1a7d98c806dadcd18f4b28c1d7612 100644 (file)
@@ -7,17 +7,20 @@
  */
 package org.opendaylight.yangtools.yang.data.api.schema;
 
-import java.util.Collection;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 
 /**
- * Normalized Node container which preserves user supplied ordering
- * and allows addressing of child elements by position.
+ * A {@link NormalizedNodeContainer} which preserves user supplied ordering and allows addressing of child elements by
+ * position. All implementations of this interface must also implement {@link OrderingAware.User}.
  *
  * @param <V> child type
  */
-public interface OrderedNodeContainer<V extends NormalizedNode<?, ?>> extends MixinNode,
-       NormalizedNode<NodeIdentifier, Collection<V>> {
+public interface OrderedNodeContainer<V extends NormalizedNode>
+        extends NormalizedNodeContainer<V>, MixinNode, OrderingAware.User {
+    @Override
+    NodeIdentifier getIdentifier();
+
     /**
      * Returns child node by position.
      *
@@ -25,12 +28,16 @@ public interface OrderedNodeContainer<V extends NormalizedNode<?, ?>> extends Mi
      * @return Child Node
      * @throws IndexOutOfBoundsException Out of bound Exception
      */
-    V getChild(int position);
+    // FIXME: 7.0.0: rename to 'childAt(int)'
+    @NonNull V getChild(int position);
 
-    /**
-     * Returns count of child nodes.
-     *
-     * @return count of child nodes.
-     */
-    int getSize();
+    // FIXME: 7.0.0: do we really mean 'List' for body?
+    //    @Override
+    //    List<V> body();
+
+    @Override
+    int hashCode();
+
+    @Override
+    boolean equals(Object obj);
 }