From 542cb03c2edb5f40cca84949c2c1270c2dce0225 Mon Sep 17 00:00:00 2001
From: Robert Varga DataSchemaNode
- * .
- *
- * @return type definition of leaf-list schema node which represents the
- * value of the argument of the YANG type
substatement
- * of the leaf-list
statement
- */
- TypeDefinition extends TypeDefinition>> getType();
-
+public interface LeafListSchemaNode extends TypedSchemaNode {
/**
* YANG 'ordered-by' statement. It defines whether the order of entries
* within this leaf-list are determined by the user or the system. If not
@@ -30,5 +19,4 @@ public interface LeafListSchemaNode extends DataSchemaNode {
* @return true if ordered-by argument is "user", false otherwise
*/
boolean isUserOrdered();
-
}
diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/LeafSchemaNode.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/LeafSchemaNode.java
index 3a3f2d91a8..21dae7eeed 100644
--- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/LeafSchemaNode.java
+++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/LeafSchemaNode.java
@@ -20,17 +20,7 @@ package org.opendaylight.yangtools.yang.model.api;
* The 'leaf' statement is used to define a leaf node in the schema tree.
*
type
of the instance of the type
- * LeafSchemaNode
.
- *
- * @return type definition which represents the value of the YANG
- * type
substatement for leaf
statement
- */
- TypeDefinition> getType();
-
+public interface LeafSchemaNode extends TypedSchemaNode {
/**
* Returns the default value of YANG leaf
.
*
diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/TypedSchemaNode.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/TypedSchemaNode.java
new file mode 100644
index 0000000000..2b344464f0
--- /dev/null
+++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/TypedSchemaNode.java
@@ -0,0 +1,25 @@
+/*
+ * 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.model.api;
+
+/**
+ * A {@link DataSchemaNode} which holds values of the same type. This can be either a single value, like
+ * in a {@link LeafSchemaNode} or multiple values, like a {@link LeafListSchemaNode}.
+ *
+ * @author Robert Varga
+ */
+public interface TypedSchemaNode extends DataSchemaNode {
+ /**
+ * Returns type of the instance which implements DataSchemaNode
.
+ *
+ * @return type definition of leaf-list schema node which represents the
+ * value of the argument of the YANG type
substatement
+ * of the leaf
or leaf-list
statement
+ */
+ TypeDefinition extends TypeDefinition>> getType();
+}
--
2.36.6