Un-deprecate CopyableNode, AddedByUsesAware
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / ModuleLike.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.model.api;
9
10 import com.google.common.annotations.Beta;
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.YangVersion;
16
17 /**
18  * This interface contains common methods for getting the schema contents from a YANG module or submodule.
19  */
20 @Beta
21 public interface ModuleLike extends DataNodeContainer, DocumentedNode, Immutable, NotificationNodeContainer,
22         QNameModuleAware {
23     /**
24      * Returns the name of the module which is specified as argument of YANG {@code module} statement.
25      *
26      * @return string with the name of the module
27      */
28     String getName();
29
30     /**
31      * Returns the semantic version of YANG module. If the semantic version is not specified, default semantic version
32      * of module is returned.
33      *
34      * @return SemVer semantic version of YANG module which is specified as argument of
35      *         {@code (urn:opendaylight:yang:extension:semantic-version?revision=2016-02-02)semantic-version} statement
36      */
37     Optional<SemVer> getSemanticVersion();
38
39     /**
40      * Returns the prefix of the module.
41      *
42      * @return string with the module prefix which is specified as argument of YANG {@code prefix} statement
43      */
44     String getPrefix();
45
46     /**
47      * Returns the YANG version.
48      *
49      * @return YANG version of this module.
50      */
51     YangVersion getYangVersion();
52
53     /**
54      * Returns the module organization.
55      *
56      * @return string with the name of the organization specified in the module as the argument of YANG
57      *         {@code organization} statement
58      */
59     Optional<String> getOrganization();
60
61     /**
62      * Returns the module contact.
63      *
64      * <p>
65      * The contact represents the person or persons to whom technical queries concerning this module should be sent,
66      * such as their name, postal address, telephone number, and electronic mail address.
67      *
68      * @return string with the contact data specified in the module as the argument of YANG {@code contact} statement
69      */
70     Optional<String> getContact();
71
72     /**
73      * Returns imports which represents YANG modules which are imported to this module via {@code import} statement.
74      *
75      * @return set of module imports which are specified in the module as the argument of YANG {@code import}
76      *         statements.
77      */
78     Collection<? extends ModuleImport> getImports();
79
80     // FIXME: YANGTOOLS-1006: this should be only in Module
81     Collection<? extends Submodule> getSubmodules();
82
83     /**
84      * Returns {@link FeatureDefinition} instances which contain data from {@code feature} statements defined in the
85      * module.
86      *
87      * <p>
88      * The feature is used to define a mechanism by which portions of the schema are marked as conditional.
89      *
90      * @return feature statements in lexicographical order which are specified in the module as the argument of YANG
91      *         {@code feature} statements.
92      */
93     Collection<? extends FeatureDefinition> getFeatures();
94
95     /**
96      * Returns {@link AugmentationSchemaNode} instances which contain data from {@code augment} statements defined
97      * in the module.
98      *
99      * @return set of the augmentation schema instances which are specified in the module as YANG {@code augment}
100      *         statement and are lexicographically ordered
101      */
102     Collection<? extends AugmentationSchemaNode> getAugmentations();
103
104     /**
105      * Returns {@link RpcDefinition} instances which contain data from {@code rpc} statements defined in the module.
106      *
107      * @return set of the RPC definition instances which are specified in the module as YANG {@code rpc} statements and
108      *         are lexicographicaly ordered
109      */
110     Collection<? extends RpcDefinition> getRpcs();
111
112     /**
113      * Returns {@link Deviation} instances which contain data from {@code deviation} statements defined in the module.
114      *
115      * @return set of the deviation instances
116      */
117     Collection<? extends Deviation> getDeviations();
118
119     /**
120      * Returns {@link IdentitySchemaNode} instances which contain data from {@code identity} statements defined in the
121      * module.
122      *
123      * @return set of identity schema node instances which are specified in the module as YANG {@code identity}
124      *         statements and are lexicographically ordered
125      */
126     Collection<? extends IdentitySchemaNode> getIdentities();
127
128     /**
129      * Returns {@link ExtensionDefinition} instances which contain data from {@code extension} statements defined in
130      * the module.
131      *
132      * @return set of extension definition instances which are specified in the module as YANG {@code extension}
133      *         statements and are lexicographically ordered
134      */
135     Collection<? extends ExtensionDefinition> getExtensionSchemaNodes();
136 }