Mass-migrate to java.util.Optional
[mdsal.git] / binding2 / mdsal-binding2-spec / src / main / java / org / opendaylight / mdsal / binding / javav2 / spec / runtime / YangModuleInfo.java
1 /*
2  * Copyright (c) 2017 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
9 package org.opendaylight.mdsal.binding.javav2.spec.runtime;
10
11 import com.google.common.annotations.Beta;
12 import java.io.InputStream;
13 import java.util.Optional;
14 import java.util.Set;
15 import org.opendaylight.yangtools.concepts.SemVer;
16 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
17
18 /**
19  * Provides basic information about YANG module
20  */
21 @Beta
22 public interface YangModuleInfo {
23
24     /**
25      * Returns yang module name
26      *
27      * @return YANG module name
28      */
29     String getName();
30
31     /**
32      * Returns revision of yang module.
33      *
34      * @return YANG module revision
35      */
36     String getRevision();
37
38     /**
39      * Returns semantic version of yang module
40      *
41      * @return YANG module semantic version
42      */
43     Optional<SemVer> getSemanticVersion();
44
45     /**
46      * Returns XML namespace associated to the YANG module
47      *
48      * @return XML namespace associated to the YANG module.
49      */
50     String getNamespace();
51
52     /**
53      * Returns set of imported modules
54      * @return set of YangModuleInfo instances
55      */
56     Set<YangModuleInfo> getImportedModules();
57
58     /**
59      * Transforms YangModuleInfo instance to its source representation
60      * @return YangModuleInfo source representation
61      */
62     SchemaSourceRepresentation getModuleSourceRepresentation();
63
64     /**
65      * Get stream of module source
66      *
67      * @return input stream of module source
68      */
69     InputStream getModuleSourceStream();
70
71 }