2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.data.api.schema;
10 import java.util.Collection;
11 import org.eclipse.jdt.annotation.NonNull;
14 * Node which is not leaf, but has child {@link NormalizedNode}s as its value. It provides iteration over its child
15 * nodes via {@link #body()}. More convenient access to child nodes are provided by {@link DistinctNodeContainer} and
16 * {@link OrderedNodeContainer}.
18 * @param <V> Child Node type
20 public interface NormalizedNodeContainer<V extends NormalizedNode> extends NormalizedNode, OrderingAware {
25 * Returns iteration of all child nodes. Order of returned child nodes may be defined by subinterfaces.
28 Collection<@NonNull V> body();
31 * Return the logical size of this container body. The default implementation defers to {@code body().size()}.
33 * @return Size of this container's body.
40 * Determine whether this container body is empty. The default implementation defers to {@code body().isEmpty()}.
42 * @return True if this container has an empty body.
44 default boolean isEmpty() {
45 return body().isEmpty();