Add default statementDefinition() methods
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / LeafListSchemaNode.java
index 99ad7fc503482cf254b82eda0e045c5cac8b5c5e..e165045f62618b2dac2d1d65a68f100d0bf18750 100644 (file)
@@ -7,21 +7,13 @@
  */
 package org.opendaylight.yangtools.yang.model.api;
 
+import java.util.Collection;
+import org.eclipse.jdt.annotation.NonNull;
+
 /**
  * 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 TypedDataSchemaNode, MustConstraintAware, ElementCountConstraintAware {
     /**
      * 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
@@ -31,4 +23,12 @@ public interface LeafListSchemaNode extends DataSchemaNode {
      */
     boolean isUserOrdered();
 
+    /**
+     * Return the default value of this leaf-list, as per the rules outlined in
+     * <a href="https://tools.ietf.org/html/rfc7950#section-7.7.4">Section 7.4.4 of RFC7950</a>. RFC6020 does not
+     * allow for default value of leaf-list, hence the returned list will be empty.
+     *
+     * @return Ordered list of Strings which specify the default values of this leaf-list
+     */
+    @NonNull Collection<? extends Object> getDefaults();
 }