import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
/**
- *
* Leaf node with multiplicity 0..1
*
* Leaf node has a value, but no child nodes in the data tree, schema
*
* @param <T> Value type
*/
-public interface LeafNode<T> extends //
- AttributesContainer,
- DataContainerChild<NodeIdentifier, T> {
-
+public interface LeafNode<T> extends AttributesContainer, DataContainerChild<NodeIdentifier, T>,
+ ValueNode<NodeIdentifier, T> {
/**
- *
* Returns value of this leaf node
*
* @return Returned value of this leaf node. Value SHOULD meet criteria defined by schema.
- *
*/
@Override
T getValue();
-
}
* @param <T>
* Value type
*/
-public interface LeafSetEntryNode<T> extends AttributesContainer, NormalizedNode<NodeWithValue, T> {
+public interface LeafSetEntryNode<T> extends AttributesContainer, NormalizedNode<NodeWithValue, T>,
+ ValueNode<NodeWithValue, T> {
/**
* Returns {@link NodeWithValue} which identifies this leaf set entry.
*/
@Override
NodeWithValue getIdentifier();
-
- /**
- *
- * Returns value of this leaf node
- *
- * <h3>Implementation notes</h3> Invocation of {@link #getValue()} must
- * provides same value as value in {@link #getIdentifier()}.
- * <code>true == this.getIdentifier().getValue().equals(this.getValue())</code>
- *
- * @return Returned value of this leaf node. Value SHOULD meet criteria
- * defined by schema.
- *
- */
- @Override
- T getValue();
}
import org.opendaylight.yangtools.concepts.Identifiable;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
/**
*
* Node which is normalized according to the YANG schema
- * is identifiable by {@link YangInstanceIdentifier}.
+ * is identifiable by a {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier}.
*
* See subinterfaces of this interface for concretization
* of node.
* @param <K> Local identifier of node
* @param <V> Value of node
*/
-public interface NormalizedNode<K extends YangInstanceIdentifier.PathArgument, V> extends Identifiable<K> {
+public interface NormalizedNode<K extends PathArgument, V> extends Identifiable<K> {
/**
* QName of the node as defined in YANG schema.
*
--- /dev/null
+/*
+ * Copyright (c) 2016 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,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.data.api.schema;
+
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+
+/**
+ * Interface holding the common trait of {@link LeafSetEntryNode} and {@link LeafNode}, which both hold a value.
+ *
+ * @author Robert Varga
+ *
+ * @param <K> Local identifier of node
+ * @param <V> Value of node
+ */
+public interface ValueNode<K extends PathArgument, V> extends NormalizedNode<K, V> {
+ /**
+ * Returns value of held by this node.
+ *
+ * <h3>Implementation notes</h3> Invocation of {@link #getValue()} must
+ * provides same value as value in {@link #getIdentifier()}.
+ * <code>true == this.getIdentifier().getValue().equals(this.getValue())</code>
+ *
+ * @return Returned value of this node. Value SHOULD meet criteria
+ * defined by schema.
+ *
+ */
+ @Override
+ V getValue();
+}