X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-model-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fmodel%2Fapi%2FModule.java;h=0355ca5f3771aa63a19615027e6fb91e2290528b;hb=0b3eb607dc40ba586df1f6b8304e46d1b9c6e38a;hp=b1b03a4dd85bf4b7741dd8a8ad156aa6321661c5;hpb=5c1f875f69e35248aa4115c429bd962160beeef4;p=yangtools.git diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java index b1b03a4dd8..0355ca5f37 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java @@ -1,93 +1,166 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.yangtools.yang.model.api; - -import java.net.URI; -import java.util.Date; -import java.util.List; -import java.util.Set; - -public interface Module extends DataNodeContainer { - - URI getNamespace(); - - String getName(); - - Date getRevision(); - - String getPrefix(); - - String getYangVersion(); - - String getDescription(); - - String getReference(); - - String getOrganization(); - - String getContact(); - - Set getImports(); - - /** - * Returns feature statements defined in module. - * - * @return feature statements in lexicographical order - */ - Set getFeatures(); - - /** - * Returns notification statements defined in module. - * - * @return notification statements in lexicographical order - */ - Set getNotifications(); - - /** - * Returns augment statements defined in module. - * - * @return augment statements - */ - Set getAugmentations(); - - /** - * Returns rpc statements defined in module. - * - * @return rpc statements in lexicographical order - */ - Set getRpcs(); - - /** - * Returns deviation statements defined in module. - * - * @return deviation statements - */ - Set getDeviations(); - - /** - * Returns identity statements defined in module. - * - * @return identity statements in lexicographical order - */ - Set getIdentities(); - - /** - * Returns extension statements defined in module. - * - * @return extension statements in lexicographical order - */ - List getExtensionSchemaNodes(); - - /** - * Returns unknown nodes defined in module. - * - * @return unknown nodes in lexicographical order - */ - List getUnknownSchemaNodes(); - -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.yangtools.yang.model.api; + +import java.net.URI; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import org.opendaylight.yangtools.concepts.Immutable; +import org.opendaylight.yangtools.concepts.SemVer; +import org.opendaylight.yangtools.yang.common.QNameModule; +import org.opendaylight.yangtools.yang.common.Revision; +import org.opendaylight.yangtools.yang.common.YangVersion; + +/** + * This interface contains the methods for getting the data from the YANG module. + */ +public interface Module extends DataNodeContainer, DocumentedNode, Immutable, NotificationNodeContainer, + NamespaceRevisionAware { + /** + * Returns the name of the module which is specified as argument of YANG {@code module} statement. + * + * @return string with the name of the module + */ + String getName(); + + /** + * Returns a {@link QNameModule}, which contains the namespace and the revision of the module. + * + * @return QNameModule identifier. + */ + QNameModule getQNameModule(); + + /** + * Returns the namespace of the module which is specified as argument of YANG {@code namespace} + * keyword. If you need both namespace and revision, please consider using {@link #getQNameModule()}. + * + * @return URI format of the namespace of the module + */ + @Override + default URI getNamespace() { + return getQNameModule().getNamespace(); + } + + /** + * Returns the revision date for the module. If you need both namespace and + * revision, please consider using {@link #getQNameModule()}. + * + * @return date of the module revision which is specified as argument of YANG {@code revison} statement + */ + @Override + default Optional getRevision() { + return getQNameModule().getRevision(); + } + + /** + * Returns the semantic version of YANG module. If the semantic version is not specified, default semantic version + * of module is returned. + * + * @return SemVer semantic version of YANG module which is specified as argument of + * {@code (urn:opendaylight:yang:extension:semantic-version?revision=2016-02-02)semantic-version} statement + */ + Optional getSemanticVersion(); + + /** + * Returns the prefix of the module. + * + * @return string with the module prefix which is specified as argument of YANG {@code prefix} statement + */ + String getPrefix(); + + /** + * Returns the YANG version. + * + * @return YANG version of this module. + */ + YangVersion getYangVersion(); + + /** + * Returns the module organization. + * + * @return string with the name of the organization specified in the module as the argument of YANG + * {@code organization} statement + */ + Optional getOrganization(); + + /** + * Returns the module contact. + * + *

+ * The contact represents the person or persons to whom technical queries concerning this module should be sent, + * such as their name, postal address, telephone number, and electronic mail address. + * + * @return string with the contact data specified in the module as the argument of YANG {@code contact} statement + */ + Optional getContact(); + + /** + * Returns imports which represents YANG modules which are imported to this module via {@code import} statement. + * + * @return set of module imports which are specified in the module as the argument of YANG {@code import} + * statements. + */ + Set getImports(); + + Set getSubmodules(); + + /** + * Returns {@link FeatureDefinition} instances which contain data from {@code feature} statements defined in the + * module. + * + *

+ * The feature is used to define a mechanism by which portions of the schema are marked as conditional. + * + * @return feature statements in lexicographical order which are specified in the module as the argument of YANG + * {@code feature} statements. + */ + Set getFeatures(); + + /** + * Returns {@link AugmentationSchemaNode} instances which contain data from {@code augment} statements defined + * in the module. + * + * @return set of the augmentation schema instances which are specified in the module as YANG {@code augment} + * statement and are lexicographically ordered + */ + Set getAugmentations(); + + /** + * Returns {@link RpcDefinition} instances which contain data from {@code rpc} statements defined in the module. + * + * @return set of the RPC definition instances which are specified in the module as YANG {@code rpc} statements and + * are lexicographicaly ordered + */ + Set getRpcs(); + + /** + * Returns {@link Deviation} instances which contain data from {@code deviation} statements defined in the module. + * + * @return set of the deviation instances + */ + Set getDeviations(); + + /** + * Returns {@link IdentitySchemaNode} instances which contain data from {@code identity} statements defined in the + * module. + * + * @return set of identity schema node instances which are specified in the module as YANG {@code identity} + * statements and are lexicographically ordered + */ + Set getIdentities(); + + /** + * Returns {@link ExtensionDefinition} instances which contain data from {@code extension} statements defined in + * the module. + * + * @return set of extension definition instances which are specified in the module as YANG {@code extension} + * statements and are lexicographically ordered + */ + List getExtensionSchemaNodes(); +}