Cleanup checkstyle in yang-{data,model}-api
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / Module.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 java.util.List;
11 import java.util.Set;
12 import javax.annotation.Nonnull;
13 import javax.annotation.Nullable;
14 import javax.annotation.concurrent.Immutable;
15 import org.opendaylight.yangtools.concepts.SemVer;
16
17 /**
18  * This interface contains the methods for getting the data from the YANG
19  * module.<br>
20  * <br>
21  * <i>Example of YANG module</i> <code><br>
22  * {@link #getName() <b><font color="#FF0000">module</font></b>} module_name{<br>
23     &nbsp;&nbsp;{@link #getYangVersion() <b><font color="#8b4513">yang-version</font></b>} "1";<br><br>
24
25     &nbsp;&nbsp;{@link #getNamespace() <b><font color="#00FF00">namespace</font></b>} "urn:module:namespace";<br>
26     &nbsp;&nbsp;{@link #getPrefix() <b><font color="#0000FF">prefix</font></b><a name="prefix"></a>} "prefix";<br><br>
27
28     &nbsp;&nbsp;{@link #getDescription() <b><font color="#b8860b">description</font></b>} "description test";<br>
29     &nbsp;&nbsp;{@link #getReference() <b><font color="#008b8b">reference</font></b>} "reference test";<br><br>
30
31     &nbsp;&nbsp;{@link #getOrganization() <b><font color="#606060">organization</font></b>}
32     "John Doe, john.doe@email.com";<br>
33     &nbsp;&nbsp;{@link #getContact() <b><font color="#FF9900">contact</font></b>} "http://www.opendaylight.org/";<br>
34     <br>
35
36     &nbsp;&nbsp;{@link #getFeatures() <b><font color="#8b0000">feature</font></b>} feature-test{<br>
37     &nbsp;&nbsp;&nbsp;&nbsp; description "description of some feature";<br>
38     &nbsp;&nbsp;}<br>
39
40     &nbsp;&nbsp;{@link #getNotifications() <b><font color="#b22222">notification</font></b>} notification-test;<br>
41     &nbsp;&nbsp;{@link #getRpcs() <b><font color="#d2691e">rpc</font></b>} rpc-test;<br>
42     <!-- &nbsp;&nbsp;{@link #getDeviations() <b><font color="#b8860b">deviation</font></b>} deviation-test;<br> -->
43     &nbsp;&nbsp;{@link #getIdentities() <b><font color="#bdb76b">identity</font></b>} identity-test;<br>
44     &nbsp;&nbsp;{@link #getExtensionSchemaNodes() <b><font color="#808000">extension</font></b>} extension-test;<br>
45
46
47     &nbsp;&nbsp;{@link #getRevision() <b><font color="#339900">revision</font></b>} 2011-08-27 {<br>
48
49     &nbsp;&nbsp;{@link #getImports() <b><font color="#9400d3">import</font></b>} other_module {<br>
50     &nbsp;&nbsp;&nbsp;&nbsp;prefix "other_module_prefix"<br>
51     &nbsp;&nbsp;&nbsp;&nbsp;revision-date 2011-08-27<br>
52     &nbsp;&nbsp;}<br><br>
53
54     &nbsp;&nbsp;container cont {<br>
55     &nbsp;&nbsp;}<br>
56
57     &nbsp;&nbsp;{@link #getAugmentations() <b><font color="#dc143c">augment</font></b>} "/cont" { ;<br>
58     &nbsp;&nbsp;}<br>
59     }
60
61     </code>
62  */
63 @Immutable
64 public interface Module extends DataNodeContainer, SourceStreamAware, ModuleIdentifier, NotificationNodeContainer {
65     /**
66      * Default semantic version of Module.
67      */
68     SemVer DEFAULT_SEMANTIC_VERSION = SemVer.create(0, 0, 0);
69
70     /**
71      * Returns the prefix of the module.
72      *
73      * @return string with the module prefix which is specified as argument of
74      *         YANG {@link Module <b><font color="#0000FF">prefix</font></b>}
75      *         keyword
76      */
77     String getPrefix();
78
79     /**
80      * Returns the YANG version. Default value is 1.
81      *
82      * @return string with the module YANG version which is specified as
83      *         argument of YANG {@link Module <b> <font
84      *         color="#8b4513">yang-version</font></b>} keyword
85      */
86     // FIXME: version 2.0.0: return YangVersion
87     String getYangVersion();
88
89     /**
90      * Returns the module description.
91      *
92      * @return string with the module description which is specified as argument
93      *         of YANG {@link Module <b><font
94      *         color="#b8860b">description</font></b>} keyword
95      */
96     String getDescription();
97
98     /**
99      * Returns the module reference.
100      *
101      * @return string with the module reference which is specified as argument
102      *         of YANG {@link Module <b><font
103      *         color="#008b8b">reference</font></b>} keyword
104      */
105     String getReference();
106
107     /**
108      * Returns the module organization.
109      *
110      * @return string with the name of the organization specified in the module
111      *         as the argument of YANG {@link Module <b><font
112      *         color="#606060">organization</font></b>} keyword
113      */
114     String getOrganization();
115
116     /**
117      * Returns the module contact.
118      *
119      * <p>
120      * The contact represents the person or persons to whom technical queries
121      * concerning this module should be sent, such as their name, postal
122      * address, telephone number, and electronic mail address.
123      *
124      * @return string with the contact data specified in the module as the
125      *         argument of YANG {@link Module <b><font
126      *         color="#FF9900">contact</font></b>} keyword
127      */
128     String getContact();
129
130     /**
131      * Returns imports which represents YANG modules which are imported to this
132      * module via <b>import</b> statement.
133      *
134      * @return set of module imports which are specified in the module as the
135      *         argument of YANG {@link Module <b><font
136      *         color="#9400d3">import</font></b>} keywords.
137      */
138     Set<ModuleImport> getImports();
139
140     Set<Module> getSubmodules();
141
142     /**
143      * Returns <code>FeatureDefinition</code> instances which contain data from
144      * <b>feature</b> statements defined in the module.
145      *
146      * <p>
147      * The feature is used to define a mechanism by which portions of the schema
148      * are marked as conditional.
149      *
150      * @return feature statements in lexicographical order which are specified
151      *         in the module as the argument of YANG {@link Module <b><font
152      *         color="#8b0000">feature</font></b>} keywords.
153      */
154     Set<FeatureDefinition> getFeatures();
155
156     /**
157      * Returns <code>AugmentationSchema</code> instances which contain data from
158      * <b>augment</b> statements defined in the module.
159      *
160      * @return set of the augmentation schema instances which are specified in
161      *         the module as YANG {@link Module <b><font
162      *         color="#dc143c">augment</font></b>} keyword and are
163      *         lexicographically ordered
164      */
165     Set<AugmentationSchema> getAugmentations();
166
167     /**
168      * Returns <code>RpcDefinition</code> instances which contain data from
169      * <b>rpc</b> statements defined in the module.
170      *
171      * @return set of the rpc definition instances which are specified in the
172      *         module as YANG {@link Module <b><font
173      *         color="#d2691e">rpc</font></b>} keywords and are lexicographicaly
174      *         ordered
175      */
176     Set<RpcDefinition> getRpcs();
177
178     /**
179      * Returns <code>Deviation</code> instances which contain data from
180      * <b>deviation</b> statements defined in the module.
181      *
182      * @return set of the deviation instances
183      */
184     Set<Deviation> getDeviations();
185
186     /**
187      * Returns <code>IdentitySchemaNode</code> instances which contain data from
188      * <b>identity</b> statements defined in the module.
189      *
190      * @return set of identity schema node instances which are specified in the
191      *         module as YANG {@link Module <b><font
192      *         color="#bdb76b">identity</font></b>} keywords and are
193      *         lexicographically ordered
194      */
195     Set<IdentitySchemaNode> getIdentities();
196
197     /**
198      * Returns <code>ExtensionDefinition</code> instances which contain data
199      * from <b>extension</b> statements defined in the module.
200      *
201      * @return set of extension definition instances which are specified in the
202      *         module as YANG {@link Module <b><font
203      *         color="#808000">extension</font></b>} keyword and are
204      *         lexicographically ordered
205      */
206     List<ExtensionDefinition> getExtensionSchemaNodes();
207
208     /**
209      * Returns unknown nodes defined in module.
210      *
211      * @return unknown nodes in lexicographical order
212      */
213     @Nonnull
214     List<UnknownSchemaNode> getUnknownSchemaNodes();
215
216     /**
217      * Get YANG source.
218      *
219      * @return YANG text of this module, or null if the source is not available.
220      * @deprecated Use {@link org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository#getSchemaSource(
221      *             org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier, Class)} instead.
222      */
223     @Deprecated
224     @Nullable String getSource();
225 }