Make AnyDataSchemaNode.getSchemaOfAnyData() return Optional
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / Module.java
index c5b33ae879b356bb47ce71ab31de80852b49818a..7717e912192671fd2555f5885df9395bb4de4306 100644 (file)
@@ -8,14 +8,13 @@
 package org.opendaylight.yangtools.yang.model.api;
 
 import java.net.URI;
-import java.util.Date;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
-import javax.annotation.Nonnull;
 import javax.annotation.concurrent.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;
 
 /**
@@ -65,7 +64,7 @@ import org.opendaylight.yangtools.yang.common.YangVersion;
     </code>
  */
 @Immutable
-public interface Module extends DataNodeContainer, NotificationNodeContainer {
+public interface Module extends DataNodeContainer, DocumentedNode, NotificationNodeContainer, NamespaceRevisionAware {
     /**
      * Returns the name of the module which is specified as argument of YANG
      * {@link Module <b><font color="#FF0000">module</font></b>} keyword.
@@ -90,6 +89,7 @@ public interface Module extends DataNodeContainer, NotificationNodeContainer {
      *
      * @return URI format of the namespace of the module
      */
+    @Override
     default URI getNamespace() {
         return getQNameModule().getNamespace();
     }
@@ -102,8 +102,8 @@ public interface Module extends DataNodeContainer, NotificationNodeContainer {
      *         YANG {@link Module <b><font color="#339900">revison</font></b>}
      *         keyword
      */
-    // FIXME: BUG-4688: should return Optional<Revision>
-    default Optional<Date> getRevision() {
+    @Override
+    default Optional<Revision> getRevision() {
         return getQNameModule().getRevision();
     }
 
@@ -144,6 +144,7 @@ public interface Module extends DataNodeContainer, NotificationNodeContainer {
      *         of YANG {@link Module <b><font
      *         color="#b8860b">description</font></b>} keyword
      */
+    @Override
     String getDescription();
 
     /**
@@ -153,6 +154,7 @@ public interface Module extends DataNodeContainer, NotificationNodeContainer {
      *         of YANG {@link Module <b><font
      *         color="#008b8b">reference</font></b>} keyword
      */
+    @Override
     String getReference();
 
     /**
@@ -213,7 +215,7 @@ public interface Module extends DataNodeContainer, NotificationNodeContainer {
      *         color="#dc143c">augment</font></b>} keyword and are
      *         lexicographically ordered
      */
-    Set<AugmentationSchema> getAugmentations();
+    Set<AugmentationSchemaNode> getAugmentations();
 
     /**
      * Returns <code>RpcDefinition</code> instances which contain data from
@@ -255,12 +257,4 @@ public interface Module extends DataNodeContainer, NotificationNodeContainer {
      *         lexicographically ordered
      */
     List<ExtensionDefinition> getExtensionSchemaNodes();
-
-    /**
-     * Returns unknown nodes defined in module.
-     *
-     * @return unknown nodes in lexicographical order
-     */
-    @Nonnull
-    List<UnknownSchemaNode> getUnknownSchemaNodes();
 }