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;
10 import com.google.common.annotations.Beta;
12 import java.util.Collection;
13 import java.util.Optional;
14 import org.opendaylight.yangtools.concepts.Immutable;
15 import org.opendaylight.yangtools.concepts.SemVer;
16 import org.opendaylight.yangtools.yang.common.QNameModule;
17 import org.opendaylight.yangtools.yang.common.Revision;
18 import org.opendaylight.yangtools.yang.common.YangVersion;
21 * This interface contains common methods for getting the schema contents from a YANG module or submodule.
24 public interface ModuleLike extends DataNodeContainer, DocumentedNode, Immutable, NotificationNodeContainer,
25 NamespaceRevisionAware {
27 * Returns the name of the module which is specified as argument of YANG {@code module} statement.
29 * @return string with the name of the module
34 * Returns a {@link QNameModule}, which contains the namespace and the revision of the module.
36 * @return QNameModule identifier.
38 QNameModule getQNameModule();
41 * Returns the namespace of the module which is specified as argument of YANG {@code namespace}
42 * keyword. If you need both namespace and revision, please consider using {@link #getQNameModule()}.
44 * @return URI format of the namespace of the module
47 default URI getNamespace() {
48 return getQNameModule().getNamespace();
52 * Returns the revision date for the module. If you need both namespace and
53 * revision, please consider using {@link #getQNameModule()}.
55 * @return date of the module revision which is specified as argument of YANG {@code revison} statement
58 default Optional<Revision> getRevision() {
59 return getQNameModule().getRevision();
63 * Returns the semantic version of YANG module. If the semantic version is not specified, default semantic version
64 * of module is returned.
66 * @return SemVer semantic version of YANG module which is specified as argument of
67 * {@code (urn:opendaylight:yang:extension:semantic-version?revision=2016-02-02)semantic-version} statement
69 Optional<SemVer> getSemanticVersion();
72 * Returns the prefix of the module.
74 * @return string with the module prefix which is specified as argument of YANG {@code prefix} statement
79 * Returns the YANG version.
81 * @return YANG version of this module.
83 YangVersion getYangVersion();
86 * Returns the module organization.
88 * @return string with the name of the organization specified in the module as the argument of YANG
89 * {@code organization} statement
91 Optional<String> getOrganization();
94 * Returns the module contact.
97 * The contact represents the person or persons to whom technical queries concerning this module should be sent,
98 * such as their name, postal address, telephone number, and electronic mail address.
100 * @return string with the contact data specified in the module as the argument of YANG {@code contact} statement
102 Optional<String> getContact();
105 * Returns imports which represents YANG modules which are imported to this module via {@code import} statement.
107 * @return set of module imports which are specified in the module as the argument of YANG {@code import}
110 Collection<? extends ModuleImport> getImports();
112 // FIXME: YANGTOOLS-1006: this should be only in Module
113 Collection<? extends Submodule> getSubmodules();
116 * Returns {@link FeatureDefinition} instances which contain data from {@code feature} statements defined in the
120 * The feature is used to define a mechanism by which portions of the schema are marked as conditional.
122 * @return feature statements in lexicographical order which are specified in the module as the argument of YANG
123 * {@code feature} statements.
125 Collection<? extends FeatureDefinition> getFeatures();
128 * Returns {@link AugmentationSchemaNode} instances which contain data from {@code augment} statements defined
131 * @return set of the augmentation schema instances which are specified in the module as YANG {@code augment}
132 * statement and are lexicographically ordered
134 Collection<? extends AugmentationSchemaNode> getAugmentations();
137 * Returns {@link RpcDefinition} instances which contain data from {@code rpc} statements defined in the module.
139 * @return set of the RPC definition instances which are specified in the module as YANG {@code rpc} statements and
140 * are lexicographicaly ordered
142 Collection<? extends RpcDefinition> getRpcs();
145 * Returns {@link Deviation} instances which contain data from {@code deviation} statements defined in the module.
147 * @return set of the deviation instances
149 Collection<? extends Deviation> getDeviations();
152 * Returns {@link IdentitySchemaNode} instances which contain data from {@code identity} statements defined in the
155 * @return set of identity schema node instances which are specified in the module as YANG {@code identity}
156 * statements and are lexicographically ordered
158 Collection<? extends IdentitySchemaNode> getIdentities();
161 * Returns {@link ExtensionDefinition} instances which contain data from {@code extension} statements defined in
164 * @return set of extension definition instances which are specified in the module as YANG {@code extension}
165 * statements and are lexicographically ordered
167 Collection<? extends ExtensionDefinition> getExtensionSchemaNodes();