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 com.google.common.annotations.Beta;
11 import java.util.Collection;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
18 * Containment node, which contains {@link MapEntryNode} of the same type, which may be quickly retrieved using a key.
21 * This node maps to the list node in YANG schema, schema and semantics of this node, its children and key construction
22 * is defined by YANG {@code list} statement and its {@code key} and {@code ordered-by} substatements.
24 public interface MapNode
25 extends DistinctNodeContainer<NodeIdentifierWithPredicates, MapEntryNode>, DataContainerChild, MixinNode {
27 Class<? extends MapNode> contract();
30 NodeIdentifier getIdentifier();
33 * Return a {@link Map} view of this node. Note that the iteration order of the returned is map is not defined in
36 * @return Map view of this node.
39 @NonNull Map<NodeIdentifierWithPredicates, MapEntryNode> asMap();
42 default Collection<@NonNull MapEntryNode> body() {
43 return asMap().values();
48 return asMap().size();
52 default boolean isEmpty() {
53 return asMap().isEmpty();