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 // FIXME: YANGTOOLS-1119: we need specializations for Module and Submodule
23 public interface Module extends DataNodeContainer, DocumentedNode, Immutable, NotificationNodeContainer,
24 NamespaceRevisionAware {
26 * Returns the name of the module which is specified as argument of YANG {@code module} statement.
28 * @return string with the name of the module
33 * Returns a {@link QNameModule}, which contains the namespace and the revision of the module.
35 * @return QNameModule identifier.
37 QNameModule getQNameModule();
40 * Returns the namespace of the module which is specified as argument of YANG {@code namespace}
41 * keyword. If you need both namespace and revision, please consider using {@link #getQNameModule()}.
43 * @return URI format of the namespace of the module
46 default URI getNamespace() {
47 return getQNameModule().getNamespace();
51 * Returns the revision date for the module. If you need both namespace and
52 * revision, please consider using {@link #getQNameModule()}.
54 * @return date of the module revision which is specified as argument of YANG {@code revison} statement
57 default Optional<Revision> getRevision() {
58 return getQNameModule().getRevision();
62 * Returns the semantic version of YANG module. If the semantic version is not specified, default semantic version
63 * of module is returned.
65 * @return SemVer semantic version of YANG module which is specified as argument of
66 * {@code (urn:opendaylight:yang:extension:semantic-version?revision=2016-02-02)semantic-version} statement
68 Optional<SemVer> getSemanticVersion();
71 * Returns the prefix of the module.
73 * @return string with the module prefix which is specified as argument of YANG {@code prefix} statement
78 * Returns the YANG version.
80 * @return YANG version of this module.
82 YangVersion getYangVersion();
85 * Returns the module organization.
87 * @return string with the name of the organization specified in the module as the argument of YANG
88 * {@code organization} statement
90 Optional<String> getOrganization();
93 * Returns the module contact.
96 * The contact represents the person or persons to whom technical queries concerning this module should be sent,
97 * such as their name, postal address, telephone number, and electronic mail address.
99 * @return string with the contact data specified in the module as the argument of YANG {@code contact} statement
101 Optional<String> getContact();
104 * Returns imports which represents YANG modules which are imported to this module via {@code import} statement.
106 * @return set of module imports which are specified in the module as the argument of YANG {@code import}
109 Collection<? extends ModuleImport> getImports();
111 Collection<? extends Module> getSubmodules();
114 * Returns {@link FeatureDefinition} instances which contain data from {@code feature} statements defined in the
118 * The feature is used to define a mechanism by which portions of the schema are marked as conditional.
120 * @return feature statements in lexicographical order which are specified in the module as the argument of YANG
121 * {@code feature} statements.
123 Collection<? extends FeatureDefinition> getFeatures();
126 * Returns {@link AugmentationSchemaNode} instances which contain data from {@code augment} statements defined
129 * @return set of the augmentation schema instances which are specified in the module as YANG {@code augment}
130 * statement and are lexicographically ordered
132 Collection<? extends AugmentationSchemaNode> getAugmentations();
135 * Returns {@link RpcDefinition} instances which contain data from {@code rpc} statements defined in the module.
137 * @return set of the RPC definition instances which are specified in the module as YANG {@code rpc} statements and
138 * are lexicographicaly ordered
140 Collection<? extends RpcDefinition> getRpcs();
143 * Returns {@link Deviation} instances which contain data from {@code deviation} statements defined in the module.
145 * @return set of the deviation instances
147 Collection<? extends Deviation> getDeviations();
150 * Returns {@link IdentitySchemaNode} instances which contain data from {@code identity} statements defined in the
153 * @return set of identity schema node instances which are specified in the module as YANG {@code identity}
154 * statements and are lexicographically ordered
156 Collection<? extends IdentitySchemaNode> getIdentities();
159 * Returns {@link ExtensionDefinition} instances which contain data from {@code extension} statements defined in
162 * @return set of extension definition instances which are specified in the module as YANG {@code extension}
163 * statements and are lexicographically ordered
165 Collection<? extends ExtensionDefinition> getExtensionSchemaNodes();