Un-deprecate CopyableNode, AddedByUsesAware
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / LeafListSchemaNode.java
index db24be09cefbeb7f64f48cac3aac746a05b9217c..34828e19814b61aeef23a9f1c4cd865fe86c0c63 100644 (file)
@@ -7,14 +7,15 @@
  */
 package org.opendaylight.yangtools.yang.model.api;
 
-import com.google.common.collect.ImmutableList;
 import java.util.Collection;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.yang.model.api.stmt.LeafListEffectiveStatement;
 
 /**
  * Interface describing YANG 'leaf-list' statement.
  */
-public interface LeafListSchemaNode extends TypedSchemaNode {
+public interface LeafListSchemaNode extends TypedDataSchemaNode, MustConstraintAware, ElementCountConstraintAware,
+        EffectiveStatementEquivalent<LeafListEffectiveStatement> {
     /**
      * 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
@@ -25,15 +26,11 @@ public interface LeafListSchemaNode extends TypedSchemaNode {
     boolean isUserOrdered();
 
     /**
-     * All implementations should override this method.
-     * The default definition of this method is used only in YANG 1.0 (RFC6020) implementation of
-     * LeafListSchemaNode which does not support default statements.
-     * YANG leaf-list statement has been changed in YANG 1.1 (RFC7950) and now allows default statements.
+     * 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 collection of Strings which specify the default values of this leaf-list
+     * @return Ordered list of Strings which specify the default values of this leaf-list
      */
-     // FIXME: version 2.0.0: make this method non-default
-    @Nonnull default Collection<String> getDefaults() {
-        return ImmutableList.of();
-    }
+    @NonNull Collection<? extends Object> getDefaults();
 }