X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-data-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fapi%2Fschema%2FMapNode.java;h=d48f2b8323a852daa8a002a1604cb831e3a87329;hb=ce2dacd877878d47df97c524f2307f0d2b393163;hp=e5631d4e7f387d65e1310c1de88069d074258d86;hpb=9f2a6a0622b44d723f2a3a6003e3c7e865e2d28b;p=yangtools.git diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapNode.java index e5631d4e7f..d48f2b8323 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapNode.java @@ -7,22 +7,49 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; +import com.google.common.annotations.Beta; import java.util.Collection; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; /** - * Containment node, which contains {@link MapEntryNode} of the same type, which may - * be quickly retrieved using key. - * - * This node maps to the list node in YANG schema, schema and semantics of this node, - * its children and key construction is defined by YANG list - * statement and its key and ordered-by substatements. + * Containment node, which contains {@link MapEntryNode} of the same type, which may be quickly retrieved using a key. * + *

+ * This node maps to the list node in YANG schema, schema and semantics of this node, its children and key construction + * is defined by YANG {@code list} statement and its {@code key} and {@code ordered-by} substatements. */ -public interface MapNode extends // - MixinNode, - DataContainerChild>, - NormalizedNodeContainer { +public interface MapNode + extends DistinctNodeContainer, DataContainerChild, MixinNode { + @Override + Class contract(); + + @Override + NodeIdentifier getIdentifier(); + + /** + * Return a {@link Map} view of this node. Note that the iteration order of the returned is map is not defined in + * this interface. + * + * @return Map view of this node. + */ + @Beta + @NonNull Map asMap(); + + @Override + default Collection<@NonNull MapEntryNode> body() { + return asMap().values(); + } + + @Override + default int size() { + return asMap().size(); + } + @Override + default boolean isEmpty() { + return asMap().isEmpty(); + } }