Update DataTreeFactory
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / LeafSetEntryNode.java
index 3209b5eed5a3f810d9c44965448f6e007bb0e570..2cc0396a23a78953456527c77ab9742825cd8f99 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -7,11 +7,37 @@
  */
 package org.opendaylight.yangtools.yang.data.api.schema;
 
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue;
-
-public interface LeafSetEntryNode<T> extends NormalizedNode<NodeWithValue, T> {
+import javax.annotation.Nonnull;
+import org.opendaylight.yangtools.yang.data.api.AttributesContainer;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
 
+/**
+ * Leaf node with multiplicity 0...n.
+ *
+ * <p>
+ * Leaf node has a value, but no child nodes in the data tree, schema
+ * for leaf node and its value is described by
+ * {@link org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode}.
+ *
+ * @param <T>
+ *            Value type
+ */
+public interface LeafSetEntryNode<T> extends AttributesContainer, NormalizedNode<NodeWithValue, T>,
+        ValueNode<NodeWithValue, T> {
+    /**
+     * Returns {@link NodeWithValue} which identifies this leaf set entry.
+     * Returned {@link NodeWithValue} contains same value as this node.
+     *
+     * <p>
+     * <h3>Implementation notes</h3> Invocation of
+     * {@link NodeWithValue#getValue()} on returned instance of
+     * {@link NodeWithValue} must returns
+     * same value as invocation of {@link #getValue()}, such as
+     * following condition is allways met:
+     * <code>true == this.getIdentifier().getValue().equals(this.getValue())</code>
+     *
+     * @return {@link NodeWithValue} which identifies this leaf set entry.
+     */
     @Override
-    public NodeWithValue getIdentifier();
-
+    @Nonnull NodeWithValue getIdentifier();
 }