2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.api;
11 import java.util.Collection;
12 import java.util.Optional;
13 import org.opendaylight.yangtools.concepts.Immutable;
14 import org.opendaylight.yangtools.concepts.SemVer;
15 import org.opendaylight.yangtools.yang.common.QNameModule;
16 import org.opendaylight.yangtools.yang.common.Revision;
17 import org.opendaylight.yangtools.yang.common.YangVersion;
20 * This interface contains the methods for getting the data from the YANG module.
22 public interface Module extends DataNodeContainer, DocumentedNode, Immutable, NotificationNodeContainer,
23 NamespaceRevisionAware {
25 * Returns the name of the module which is specified as argument of YANG {@code module} statement.
27 * @return string with the name of the module
32 * Returns a {@link QNameModule}, which contains the namespace and the revision of the module.
34 * @return QNameModule identifier.
36 QNameModule getQNameModule();
39 * Returns the namespace of the module which is specified as argument of YANG {@code namespace}
40 * keyword. If you need both namespace and revision, please consider using {@link #getQNameModule()}.
42 * @return URI format of the namespace of the module
45 default URI getNamespace() {
46 return getQNameModule().getNamespace();
50 * Returns the revision date for the module. If you need both namespace and
51 * revision, please consider using {@link #getQNameModule()}.
53 * @return date of the module revision which is specified as argument of YANG {@code revison} statement
56 default Optional<Revision> getRevision() {
57 return getQNameModule().getRevision();
61 * Returns the semantic version of YANG module. If the semantic version is not specified, default semantic version
62 * of module is returned.
64 * @return SemVer semantic version of YANG module which is specified as argument of
65 * {@code (urn:opendaylight:yang:extension:semantic-version?revision=2016-02-02)semantic-version} statement
67 Optional<SemVer> getSemanticVersion();
70 * Returns the prefix of the module.
72 * @return string with the module prefix which is specified as argument of YANG {@code prefix} statement
77 * Returns the YANG version.
79 * @return YANG version of this module.
81 YangVersion getYangVersion();
84 * Returns the module organization.
86 * @return string with the name of the organization specified in the module as the argument of YANG
87 * {@code organization} statement
89 Optional<String> getOrganization();
92 * Returns the module contact.
95 * The contact represents the person or persons to whom technical queries concerning this module should be sent,
96 * such as their name, postal address, telephone number, and electronic mail address.
98 * @return string with the contact data specified in the module as the argument of YANG {@code contact} statement
100 Optional<String> getContact();
103 * Returns imports which represents YANG modules which are imported to this module via {@code import} statement.
105 * @return set of module imports which are specified in the module as the argument of YANG {@code import}
108 Collection<? extends ModuleImport> getImports();
110 Collection<? extends Module> getSubmodules();
113 * Returns {@link FeatureDefinition} instances which contain data from {@code feature} statements defined in the
117 * The feature is used to define a mechanism by which portions of the schema are marked as conditional.
119 * @return feature statements in lexicographical order which are specified in the module as the argument of YANG
120 * {@code feature} statements.
122 Collection<? extends FeatureDefinition> getFeatures();
125 * Returns {@link AugmentationSchemaNode} instances which contain data from {@code augment} statements defined
128 * @return set of the augmentation schema instances which are specified in the module as YANG {@code augment}
129 * statement and are lexicographically ordered
131 Collection<? extends AugmentationSchemaNode> getAugmentations();
134 * Returns {@link RpcDefinition} instances which contain data from {@code rpc} statements defined in the module.
136 * @return set of the RPC definition instances which are specified in the module as YANG {@code rpc} statements and
137 * are lexicographicaly ordered
139 Collection<? extends RpcDefinition> getRpcs();
142 * Returns {@link Deviation} instances which contain data from {@code deviation} statements defined in the module.
144 * @return set of the deviation instances
146 Collection<? extends Deviation> getDeviations();
149 * Returns {@link IdentitySchemaNode} instances which contain data from {@code identity} statements defined in the
152 * @return set of identity schema node instances which are specified in the module as YANG {@code identity}
153 * statements and are lexicographically ordered
155 Collection<? extends IdentitySchemaNode> getIdentities();
158 * Returns {@link ExtensionDefinition} instances which contain data from {@code extension} statements defined in
161 * @return set of extension definition instances which are specified in the module as YANG {@code extension}
162 * statements and are lexicographically ordered
164 Collection<? extends ExtensionDefinition> getExtensionSchemaNodes();