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;
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;
19 * This interface contains common methods for getting the schema contents from a YANG module or submodule.
22 public interface ModuleLike extends DataNodeContainer, DocumentedNode, Immutable, NotificationNodeContainer,
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 the semantic version of YANG module. If the semantic version is not specified, default semantic version
33 * of module is returned.
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
38 Optional<SemVer> getSemanticVersion();
41 * Returns the prefix of the module.
43 * @return string with the module prefix which is specified as argument of YANG {@code prefix} statement
48 * Returns the YANG version.
50 * @return YANG version of this module.
52 YangVersion getYangVersion();
55 * Returns the module organization.
57 * @return string with the name of the organization specified in the module as the argument of YANG
58 * {@code organization} statement
60 Optional<String> getOrganization();
63 * Returns the module contact.
66 * The contact represents the person or persons to whom technical queries concerning this module should be sent,
67 * such as their name, postal address, telephone number, and electronic mail address.
69 * @return string with the contact data specified in the module as the argument of YANG {@code contact} statement
71 Optional<String> getContact();
74 * Returns imports which represents YANG modules which are imported to this module via {@code import} statement.
76 * @return set of module imports which are specified in the module as the argument of YANG {@code import}
79 Collection<? extends @NonNull ModuleImport> getImports();
81 // FIXME: YANGTOOLS-1006: this should be only in Module
82 Collection<? extends @NonNull Submodule> getSubmodules();
85 * Returns {@link FeatureDefinition} instances which contain data from {@code feature} statements defined in the
89 * The feature is used to define a mechanism by which portions of the schema are marked as conditional.
91 * @return feature statements in lexicographical order which are specified in the module as the argument of YANG
92 * {@code feature} statements.
94 Collection<? extends @NonNull FeatureDefinition> getFeatures();
97 * Returns {@link AugmentationSchemaNode} instances which contain data from {@code augment} statements defined
100 * @return set of the augmentation schema instances which are specified in the module as YANG {@code augment}
101 * statement and are lexicographically ordered
103 Collection<? extends @NonNull AugmentationSchemaNode> getAugmentations();
106 * Returns {@link RpcDefinition} instances which contain data from {@code rpc} statements defined in the module.
108 * @return set of the RPC definition instances which are specified in the module as YANG {@code rpc} statements and
109 * are lexicographicaly ordered
111 Collection<? extends @NonNull RpcDefinition> getRpcs();
114 * Returns {@link Deviation} instances which contain data from {@code deviation} statements defined in the module.
116 * @return set of the deviation instances
118 Collection<? extends @NonNull Deviation> getDeviations();
121 * Returns {@link IdentitySchemaNode} instances which contain data from {@code identity} statements defined in the
124 * @return set of identity schema node instances which are specified in the module as YANG {@code identity}
125 * statements and are lexicographically ordered
127 Collection<? extends @NonNull IdentitySchemaNode> getIdentities();
130 * Returns {@link ExtensionDefinition} instances which contain data from {@code extension} statements defined in
133 * @return set of extension definition instances which are specified in the module as YANG {@code extension}
134 * statements and are lexicographically ordered
136 Collection<? extends @NonNull ExtensionDefinition> getExtensionSchemaNodes();