Cleanup DocumentedNode
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / DocumentedNode.java
index 07ae031d9380c4158b0ad45778ea0afbd48d83ec..b66e447587bd2f38d787bf15752d2af5b6d6f13a 100644 (file)
@@ -9,8 +9,8 @@ package org.opendaylight.yangtools.yang.model.api;
 
 import com.google.common.collect.ImmutableList;
 import java.util.List;
+import java.util.Optional;
 import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 
 /**
  * Node which can have documentation assigned.
@@ -19,29 +19,23 @@ public interface DocumentedNode {
     /**
      * Returns the value of the argument of YANG <code>description</code> keyword.
      *
-     * @return string with the description, or null if description was not provided.
+     * @return string with the description, or empty if description was not provided.
      */
-    // FIXME: version 2.0.0: make this method non-default
-    @Nullable default String getDescription() {
-        return null;
-    }
+    Optional<String> getDescription();
 
     /**
      * Returns the value of the argument of YANG <code>reference</code> keyword.
      *
-     * @return string with reference to some other document, or null if reference was not provided.
+     * @return string with reference to some other document, or empty if reference was not provided.
      */
-    // FIXME: version 2.0.0: make this method non-default
-    @Nullable default String getReference() {
-        return null;
-    }
+    Optional<String> getReference();
 
     /**
-     * Returns unknown schema nodes which belongs to this instance.
+     * Returns unknown schema nodes which belongs to this instance. Default implementation returns an empty list.
      *
      * @return list of unknown schema nodes defined under this node.
      */
-    default @Nonnull List<UnknownSchemaNode> getUnknownSchemaNodes() {
+    @Nonnull default List<UnknownSchemaNode> getUnknownSchemaNodes() {
         return ImmutableList.of();
     }