Cleanup checkstyle in yang-{data,model}-api
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / ListSchemaNode.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 java.util.List;
13 import javax.annotation.Nonnull;
14 import org.opendaylight.yangtools.yang.common.QName;
15
16 /**
17  * Interface describing YANG 'list' statement.
18  * <p>
19  * The 'list' statement is used to define an interior data node in the schema
20  * tree. A list entry is uniquely identified by the values of the list's keys,
21  * if defined.
22  * </p>
23  */
24 public interface ListSchemaNode extends DataNodeContainer, AugmentationTarget, DataSchemaNode,
25         NotificationNodeContainer, ActionNodeContainer {
26     /**
27      * Returns the list of leaf identifiers.
28      *
29      * @return List of QNames of leaf identifiers of this list
30      */
31     List<QName> getKeyDefinition();
32
33     /**
34      * YANG 'ordered-by' statement. It defines whether the order of entries
35      * within a list are determined by the user or the system. If not present,
36      * default is false.
37      *
38      * @return true if ordered-by argument is "user", false otherwise
39      */
40     boolean isUserOrdered();
41
42     /**
43      * Returns unique constraints.
44      *
45      * @return Collection of unique constraints of this list schema node
46      */
47     @Nonnull
48     default Collection<UniqueConstraint> getUniqueConstraints() {
49         return ImmutableList.of();
50     }
51 }