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.yang.common.YangVersion;
18 * This interface contains common methods for getting the schema contents from a YANG module or submodule.
21 public interface ModuleLike extends DataNodeContainer, DocumentedNode, Immutable, NotificationNodeContainer,
24 * Returns the name of the module which is specified as argument of YANG {@code module} statement.
26 * @return string with the name of the module
31 * Returns the prefix of the module.
33 * @return string with the module prefix which is specified as argument of YANG {@code prefix} statement
38 * Returns the YANG version.
40 * @return YANG version of this module.
42 YangVersion getYangVersion();
45 * Returns the module organization.
47 * @return string with the name of the organization specified in the module as the argument of YANG
48 * {@code organization} statement
50 Optional<String> getOrganization();
53 * Returns the module contact.
56 * The contact represents the person or persons to whom technical queries concerning this module should be sent,
57 * such as their name, postal address, telephone number, and electronic mail address.
59 * @return string with the contact data specified in the module as the argument of YANG {@code contact} statement
61 Optional<String> getContact();
64 * Returns imports which represents YANG modules which are imported to this module via {@code import} statement.
66 * @return set of module imports which are specified in the module as the argument of YANG {@code import}
69 Collection<? extends @NonNull ModuleImport> getImports();
71 // FIXME: YANGTOOLS-1006: this should be only in Module
72 Collection<? extends @NonNull Submodule> getSubmodules();
75 * Returns {@link FeatureDefinition} instances which contain data from {@code feature} statements defined in the
79 * The feature is used to define a mechanism by which portions of the schema are marked as conditional.
81 * @return feature statements in lexicographical order which are specified in the module as the argument of YANG
82 * {@code feature} statements.
84 Collection<? extends @NonNull FeatureDefinition> getFeatures();
87 * Returns {@link AugmentationSchemaNode} instances which contain data from {@code augment} statements defined
90 * @return set of the augmentation schema instances which are specified in the module as YANG {@code augment}
91 * statement and are lexicographically ordered
93 Collection<? extends @NonNull AugmentationSchemaNode> getAugmentations();
96 * Returns {@link RpcDefinition} instances which contain data from {@code rpc} statements defined in the module.
98 * @return set of the RPC definition instances which are specified in the module as YANG {@code rpc} statements and
99 * are lexicographicaly ordered
101 Collection<? extends @NonNull RpcDefinition> getRpcs();
104 * Returns {@link Deviation} instances which contain data from {@code deviation} statements defined in the module.
106 * @return set of the deviation instances
108 Collection<? extends @NonNull Deviation> getDeviations();
111 * Returns {@link IdentitySchemaNode} instances which contain data from {@code identity} statements defined in the
114 * @return set of identity schema node instances which are specified in the module as YANG {@code identity}
115 * statements and are lexicographically ordered
117 Collection<? extends @NonNull IdentitySchemaNode> getIdentities();
120 * Returns {@link ExtensionDefinition} instances which contain data from {@code extension} statements defined in
123 * @return set of extension definition instances which are specified in the module as YANG {@code extension}
124 * statements and are lexicographically ordered
126 Collection<? extends @NonNull ExtensionDefinition> getExtensionSchemaNodes();