Remove deprecated yang.model.api.stmt constructs
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / stmt / DocumentedDeclaredStatement.java
index 90547b28250ece0f5ae982b575280e6e4de2f51d..fddffb927fad81108646be63f515cdc2bce310ce 100644 (file)
@@ -9,30 +9,35 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
 import java.util.Optional;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
 
 /**
  * Common interface for statements which contain either a description/reference or a description/reference/status combo.
  */
 @Beta
-public interface DocumentedDeclaredStatement<T> extends DeclaredStatement<T>, DocumentationGroup {
-    @Override
-    default DescriptionStatement getDescription() {
-        final Optional<DescriptionStatement> opt = findFirstDeclaredSubstatement(DescriptionStatement.class);
-        return opt.isPresent() ? opt.get() : null;
+public interface DocumentedDeclaredStatement<T> extends DeclaredStatement<T> {
+    /**
+     * Return description statement, if available.
+     *
+     * @return description statement
+     */
+    default @NonNull Optional<DescriptionStatement> getDescription() {
+        return findFirstDeclaredSubstatement(DescriptionStatement.class);
     }
 
-    @Override
-    default ReferenceStatement getReference() {
-        final Optional<ReferenceStatement> opt = findFirstDeclaredSubstatement(ReferenceStatement.class);
-        return opt.isPresent() ? opt.get() : null;
+    /**
+     * Return description statement, if available.
+     *
+     * @return description statement
+     */
+    default @NonNull Optional<ReferenceStatement> getReference() {
+        return findFirstDeclaredSubstatement(ReferenceStatement.class);
     }
 
-    interface WithStatus<T> extends DocumentedDeclaredStatement<T>, DocumentationGroup.WithStatus {
-        @Override
-        default StatusStatement getStatus() {
-            final Optional<StatusStatement> opt = findFirstDeclaredSubstatement(StatusStatement.class);
-            return opt.isPresent() ? opt.get() : null;
+    interface WithStatus<T> extends DocumentedDeclaredStatement<T> {
+        default @NonNull Optional<StatusStatement> getStatus() {
+            return findFirstDeclaredSubstatement(StatusStatement.class);
         }
     }
 }