9ede1bf913a87aff6b923ef0e4d90cf7bed1ed05
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / ModuleIdentifier.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
9 package org.opendaylight.yangtools.yang.model.api;
10
11 import java.net.URI;
12 import java.util.Date;
13 import org.opendaylight.yangtools.concepts.SemVer;
14 import org.opendaylight.yangtools.yang.common.QNameModule;
15
16
17 public interface ModuleIdentifier {
18     /**
19      * Returns a {@link QNameModule}, which contains the namespace and
20      * the revision of the module.
21      *
22      * @return QNameModule identifier.
23      */
24     QNameModule getQNameModule();
25
26     /**
27      * Returns the name of the module which is specified as argument of YANG
28      * {@link Module <b><font color="#FF0000">module</font></b>} keyword
29      *
30      * @return string with the name of the module
31      */
32     String getName();
33
34     /**
35      * Returns the namespace of the module which is specified as argument of
36      * YANG {@link Module <b><font color="#00FF00">namespace</font></b>}
37      * keyword. If you need both namespace and revision, please consider using
38      * {@link #getQNameModule()}.
39      *
40      * @return URI format of the namespace of the module
41      */
42     // FIXME: 2.0.0: should be a default method calling getQNameModule().getNamespace()
43     URI getNamespace();
44
45     /**
46      * Returns the revision date for the module. If you need both namespace and
47      * revision, please consider using {@link #getQNameModule()}.
48      *
49      * @return date of the module revision which is specified as argument of
50      *         YANG {@link Module <b><font color="#339900">revison</font></b>}
51      *         keyword
52      */
53     // FIXME: BUG-4688: should return Revision
54     // FIXME: BUG-4688: should be a default method calling getQNameModule().getRevision().get()
55     Date getRevision();
56
57     /**
58      * Returns the openconfig version of yang module.
59      *
60      * If the openconfig version is not specified, default openconfig version of
61      * module is returned.
62      *
63      * @return SemVer openconfig version of yang module which is specified as
64      *         argument of
65      *         (http://openconfig.net/yang/openconfig-ext)openconfig-version statement
66      */
67     default SemVer getOpenconfigVersion() {
68         return Module.DEFAULT_OPENCONFIG_VERSION;
69     }
70 }