Split out NormalizedContainer
[yangtools.git] / data / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / NormalizedNodeContainer.java
index 3a8d5c5dc2cab6cd58c0b0c43734b13dfa837946..0cc8047090d7895dbfdc2adc06e023a5461f4372 100644 (file)
@@ -7,9 +7,6 @@
  */
 package org.opendaylight.yangtools.yang.data.api.schema;
 
-import java.util.Collection;
-import org.eclipse.jdt.annotation.NonNull;
-
 /**
  * Node which is not leaf, but has child {@link NormalizedNode}s as its value. It provides iteration over its child
  * nodes via {@link #body()}. More convenient access to child nodes are provided by {@link DistinctNodeContainer} and
@@ -17,32 +14,7 @@ import org.eclipse.jdt.annotation.NonNull;
  *
  * @param <V> Child Node type
  */
-public sealed interface NormalizedNodeContainer<V extends NormalizedNode> extends NormalizedNode, OrderingAware
+public sealed interface NormalizedNodeContainer<V extends NormalizedNode> extends NormalizedContainer<V>, NormalizedNode
         permits DistinctNodeContainer, OrderedNodeContainer {
-    /**
-     * {@inheritDoc}
-     *
-     * <p>
-     * Returns iteration of all child nodes. Order of returned child nodes may be defined by subinterfaces.
-     */
-    @Override
-    Collection<@NonNull V> body();
-
-    /**
-     * Return the logical size of this container body. The default implementation defers to {@code body().size()}.
-     *
-     * @return Size of this container's body.
-     */
-    default int size() {
-        return body().size();
-    }
-
-    /**
-     * Determine whether this container body is empty. The default implementation defers to {@code body().isEmpty()}.
-     *
-     * @return True if this container has an empty body.
-     */
-    default boolean isEmpty() {
-        return body().isEmpty();
-    }
+    // Just a composite of NormalizedContainer and NormalizedNode
 }