Make ConstraintMetaDefition attributes Optional
[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      * Returns the value of the argument of YANG <code>description</code> keyword.
21      *
22      * @return string with the description, or null if description was not provided.
23      */
24     // FIXME: version 2.0.0: make this method non-default
25     @Nullable default String getDescription() {
26         return null;
27     }
28
29     /**
30      * Returns the value of the argument of YANG <code>reference</code> keyword.
31      *
32      * @return string with reference to some other document, or null if reference was not provided.
33      */
34     // FIXME: version 2.0.0: make this method non-default
35     @Nullable default String getReference() {
36         return null;
37     }
38
39     /**
40      * Returns unknown schema nodes which belongs to this instance.
41      *
42      * @return list of unknown schema nodes defined under this node.
43      */
44     default @Nonnull List<UnknownSchemaNode> getUnknownSchemaNodes() {
45         return ImmutableList.of();
46     }
47
48     interface WithStatus extends DocumentedNode {
49         /**
50          * Returns status of the instance of the type <code>SchemaNode</code>.
51          *
52          * @return status of this node which represents the argument of the YANG
53          *         <code>status</code> substatement
54          */
55         @Nonnull Status getStatus();
56     }
57 }