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