Cleanup checkstyle in yang-{data,model}-api
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / DocumentedNode.java
1 /*
2  * Copyright (c) 2014 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.List;
12 import javax.annotation.Nonnull;
13 import javax.annotation.Nullable;
14
15 /**
16  * Node which can have documentation assigned.
17  */
18 public interface DocumentedNode {
19     /**
20      * All implementations should override this method.
21      * The default definition of this method is used only in YANG 1.0 (RFC6020) implementations of
22      * ModuleImport which do not allow a description statement.
23      * YANG import statement has been changed in YANG 1.1 (RFC7950) and can now contain a description statement.
24      *
25      * @return string that represents the argument of description statement
26      */
27     // FIXME: version 2.0.0: make this method non-default
28     @Nullable default String getDescription() {
29         return null;
30     }
31
32     /**
33      * All implementations should override this method.
34      * The default definition of this method is used only in YANG 1.0 (RFC6020) implementations of
35      * ModuleImport which do not allow a reference statement.
36      * YANG import statement has been changed in YANG 1.1 (RFC7950) and can now contain a reference statement.
37      *
38      * @return string that represents the argument of reference statement
39      */
40     // FIXME: version 2.0.0: make this method non-default
41     @Nullable default String getReference() {
42         return null;
43     }
44
45     /**
46      * Returns unknown schema nodes which belongs to this instance.
47      *
48      * @return list of unknown schema nodes defined under this node.
49      */
50     default @Nonnull List<UnknownSchemaNode> getUnknownSchemaNodes() {
51         return ImmutableList.of();
52     }
53
54     interface WithStatus extends DocumentedNode {
55         /**
56          * Returns status of the instance of the type <code>SchemaNode</code>.
57          *
58          * @return status of this node which represents the argument of the YANG
59          *         <code>status</code> substatement
60          */
61         @Nonnull Status getStatus();
62     }
63 }