Deprecate getSemanticVersion() for removal
[yangtools.git] / model / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / ModuleLike.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.annotations.Beta;
11 import java.util.Collection;
12 import java.util.Optional;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.concepts.Immutable;
15 import org.opendaylight.yangtools.concepts.SemVer;
16 import org.opendaylight.yangtools.yang.common.YangVersion;
17
18 /**
19  * This interface contains common methods for getting the schema contents from a YANG module or submodule.
20  */
21 @Beta
22 public interface ModuleLike extends DataNodeContainer, DocumentedNode, Immutable, NotificationNodeContainer,
23         QNameModuleAware {
24     /**
25      * Returns the name of the module which is specified as argument of YANG {@code module} statement.
26      *
27      * @return string with the name of the module
28      */
29     String getName();
30
31     /**
32      * Returns the semantic version of YANG module. If the semantic version is not specified, default semantic version
33      * of module is returned.
34      *
35      * @return SemVer semantic version of YANG module which is specified as argument of
36      *         {@code (urn:opendaylight:yang:extension:semantic-version?revision=2016-02-02)semantic-version} statement
37      * @deprecated Semantic version imports are deprecated.
38      */
39     @Deprecated(since = "8.0.4", forRemoval = true)
40     Optional<SemVer> getSemanticVersion();
41
42     /**
43      * Returns the prefix of the module.
44      *
45      * @return string with the module prefix which is specified as argument of YANG {@code prefix} statement
46      */
47     String getPrefix();
48
49     /**
50      * Returns the YANG version.
51      *
52      * @return YANG version of this module.
53      */
54     YangVersion getYangVersion();
55
56     /**
57      * Returns the module organization.
58      *
59      * @return string with the name of the organization specified in the module as the argument of YANG
60      *         {@code organization} statement
61      */
62     Optional<String> getOrganization();
63
64     /**
65      * Returns the module contact.
66      *
67      * <p>
68      * The contact represents the person or persons to whom technical queries concerning this module should be sent,
69      * such as their name, postal address, telephone number, and electronic mail address.
70      *
71      * @return string with the contact data specified in the module as the argument of YANG {@code contact} statement
72      */
73     Optional<String> getContact();
74
75     /**
76      * Returns imports which represents YANG modules which are imported to this module via {@code import} statement.
77      *
78      * @return set of module imports which are specified in the module as the argument of YANG {@code import}
79      *         statements.
80      */
81     Collection<? extends @NonNull ModuleImport> getImports();
82
83     // FIXME: YANGTOOLS-1006: this should be only in Module
84     Collection<? extends @NonNull Submodule> getSubmodules();
85
86     /**
87      * Returns {@link FeatureDefinition} instances which contain data from {@code feature} statements defined in the
88      * module.
89      *
90      * <p>
91      * The feature is used to define a mechanism by which portions of the schema are marked as conditional.
92      *
93      * @return feature statements in lexicographical order which are specified in the module as the argument of YANG
94      *         {@code feature} statements.
95      */
96     Collection<? extends @NonNull FeatureDefinition> getFeatures();
97
98     /**
99      * Returns {@link AugmentationSchemaNode} instances which contain data from {@code augment} statements defined
100      * in the module.
101      *
102      * @return set of the augmentation schema instances which are specified in the module as YANG {@code augment}
103      *         statement and are lexicographically ordered
104      */
105     Collection<? extends @NonNull AugmentationSchemaNode> getAugmentations();
106
107     /**
108      * Returns {@link RpcDefinition} instances which contain data from {@code rpc} statements defined in the module.
109      *
110      * @return set of the RPC definition instances which are specified in the module as YANG {@code rpc} statements and
111      *         are lexicographicaly ordered
112      */
113     Collection<? extends @NonNull RpcDefinition> getRpcs();
114
115     /**
116      * Returns {@link Deviation} instances which contain data from {@code deviation} statements defined in the module.
117      *
118      * @return set of the deviation instances
119      */
120     Collection<? extends @NonNull Deviation> getDeviations();
121
122     /**
123      * Returns {@link IdentitySchemaNode} instances which contain data from {@code identity} statements defined in the
124      * module.
125      *
126      * @return set of identity schema node instances which are specified in the module as YANG {@code identity}
127      *         statements and are lexicographically ordered
128      */
129     Collection<? extends @NonNull IdentitySchemaNode> getIdentities();
130
131     /**
132      * Returns {@link ExtensionDefinition} instances which contain data from {@code extension} statements defined in
133      * the module.
134      *
135      * @return set of extension definition instances which are specified in the module as YANG {@code extension}
136      *         statements and are lexicographically ordered
137      */
138     Collection<? extends @NonNull ExtensionDefinition> getExtensionSchemaNodes();
139 }