Fix leafref require-instance implementation
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / LeafListSchemaNode.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.model.api;
9
10 import com.google.common.collect.ImmutableList;
11 import java.util.Collection;
12 import javax.annotation.Nonnull;
13
14 /**
15  * Interface describing YANG 'leaf-list' statement.
16  */
17 public interface LeafListSchemaNode extends TypedSchemaNode {
18     /**
19      * YANG 'ordered-by' statement. It defines whether the order of entries
20      * within this leaf-list are determined by the user or the system. If not
21      * present, default is false.
22      *
23      * @return true if ordered-by argument is "user", false otherwise
24      */
25     boolean isUserOrdered();
26
27     /**
28      * All implementations should override this method.
29      * The default definition of this method is used only in YANG 1.0 (RFC6020) implementation of
30      * LeafListSchemaNode which does not support default statements.
31      * YANG leaf-list statement has been changed in YANG 1.1 (RFC7950) and now allows default statements.
32      *
33      * @return collection of Strings which specify the default values of this leaf-list
34      */
35      // FIXME: version 2.0.0: make this method non-default
36     @Nonnull default Collection<String> getDefaults() {
37         return ImmutableList.of();
38     }
39 }