Fix Module.getVersion()
[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.concurrent.Immutable;
14 import org.opendaylight.yangtools.concepts.SemVer;
15 import org.opendaylight.yangtools.yang.common.YangVersion;
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, 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.
81      *
82      * @return YANG version of this module.
83      */
84     YangVersion getYangVersion();
85
86     /**
87      * Returns the module description.
88      *
89      * @return string with the module description which is specified as argument
90      *         of YANG {@link Module <b><font
91      *         color="#b8860b">description</font></b>} keyword
92      */
93     String getDescription();
94
95     /**
96      * Returns the module reference.
97      *
98      * @return string with the module reference which is specified as argument
99      *         of YANG {@link Module <b><font
100      *         color="#008b8b">reference</font></b>} keyword
101      */
102     String getReference();
103
104     /**
105      * Returns the module organization.
106      *
107      * @return string with the name of the organization specified in the module
108      *         as the argument of YANG {@link Module <b><font
109      *         color="#606060">organization</font></b>} keyword
110      */
111     String getOrganization();
112
113     /**
114      * Returns the module contact.
115      *
116      * <p>
117      * The contact represents the person or persons to whom technical queries
118      * concerning this module should be sent, such as their name, postal
119      * address, telephone number, and electronic mail address.
120      *
121      * @return string with the contact data specified in the module as the
122      *         argument of YANG {@link Module <b><font
123      *         color="#FF9900">contact</font></b>} keyword
124      */
125     String getContact();
126
127     /**
128      * Returns imports which represents YANG modules which are imported to this
129      * module via <b>import</b> statement.
130      *
131      * @return set of module imports which are specified in the module as the
132      *         argument of YANG {@link Module <b><font
133      *         color="#9400d3">import</font></b>} keywords.
134      */
135     Set<ModuleImport> getImports();
136
137     Set<Module> getSubmodules();
138
139     /**
140      * Returns <code>FeatureDefinition</code> instances which contain data from
141      * <b>feature</b> statements defined in the module.
142      *
143      * <p>
144      * The feature is used to define a mechanism by which portions of the schema
145      * are marked as conditional.
146      *
147      * @return feature statements in lexicographical order which are specified
148      *         in the module as the argument of YANG {@link Module <b><font
149      *         color="#8b0000">feature</font></b>} keywords.
150      */
151     Set<FeatureDefinition> getFeatures();
152
153     /**
154      * Returns <code>AugmentationSchema</code> instances which contain data from
155      * <b>augment</b> statements defined in the module.
156      *
157      * @return set of the augmentation schema instances which are specified in
158      *         the module as YANG {@link Module <b><font
159      *         color="#dc143c">augment</font></b>} keyword and are
160      *         lexicographically ordered
161      */
162     Set<AugmentationSchema> getAugmentations();
163
164     /**
165      * Returns <code>RpcDefinition</code> instances which contain data from
166      * <b>rpc</b> statements defined in the module.
167      *
168      * @return set of the rpc definition instances which are specified in the
169      *         module as YANG {@link Module <b><font
170      *         color="#d2691e">rpc</font></b>} keywords and are lexicographicaly
171      *         ordered
172      */
173     Set<RpcDefinition> getRpcs();
174
175     /**
176      * Returns <code>Deviation</code> instances which contain data from
177      * <b>deviation</b> statements defined in the module.
178      *
179      * @return set of the deviation instances
180      */
181     Set<Deviation> getDeviations();
182
183     /**
184      * Returns <code>IdentitySchemaNode</code> instances which contain data from
185      * <b>identity</b> statements defined in the module.
186      *
187      * @return set of identity schema node instances which are specified in the
188      *         module as YANG {@link Module <b><font
189      *         color="#bdb76b">identity</font></b>} keywords and are
190      *         lexicographically ordered
191      */
192     Set<IdentitySchemaNode> getIdentities();
193
194     /**
195      * Returns <code>ExtensionDefinition</code> instances which contain data
196      * from <b>extension</b> statements defined in the module.
197      *
198      * @return set of extension definition instances which are specified in the
199      *         module as YANG {@link Module <b><font
200      *         color="#808000">extension</font></b>} keyword and are
201      *         lexicographically ordered
202      */
203     List<ExtensionDefinition> getExtensionSchemaNodes();
204
205     /**
206      * Returns unknown nodes defined in module.
207      *
208      * @return unknown nodes in lexicographical order
209      */
210     @Nonnull
211     List<UnknownSchemaNode> getUnknownSchemaNodes();
212 }