This helps users such as the Java Binding implementation.
Change-Id: Iec2b47f6b6e5974e506edc25905c3a77ee167565
Signed-off-by: Robert Varga <rovarga@cisco.com>
/**
* Interface describing YANG 'leaf-list' statement.
*/
-public interface LeafListSchemaNode extends DataSchemaNode {
-
- /**
- * Returns type of the instance which implements <code>DataSchemaNode</code>
- * .
- *
- * @return type definition of leaf-list schema node which represents the
- * value of the argument of the YANG <code>type</code> substatement
- * of the <code>leaf-list</code> 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
* @return true if ordered-by argument is "user", false otherwise
*/
boolean isUserOrdered();
-
}
* The 'leaf' statement is used to define a leaf node in the schema tree.
* </p>
*/
-public interface LeafSchemaNode extends DataSchemaNode {
-
- /**
- * Returns the YANG <code>type</code> of the instance of the type
- * <code>LeafSchemaNode</code>.
- *
- * @return type definition which represents the value of the YANG
- * <code>type</code> substatement for <code>leaf</code> statement
- */
- TypeDefinition<?> getType();
-
+public interface LeafSchemaNode extends TypedSchemaNode {
/**
* Returns the default value of YANG <code>leaf</code>.
*
--- /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.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 <code>DataSchemaNode</code>.
+ *
+ * @return type definition of leaf-list schema node which represents the
+ * value of the argument of the YANG <code>type</code> substatement
+ * of the <code>leaf</code> or <code>leaf-list</code> statement
+ */
+ TypeDefinition<? extends TypeDefinition<?>> getType();
+}