Improve OperationDefinition guarantees 82/104882/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 14 Mar 2023 20:11:39 +0000 (21:11 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 14 Mar 2023 20:11:39 +0000 (21:11 +0100)
We guarantee non-nullness across the board, use @NonNullByDefault
to express that.

Change-Id: I2838ff15dfe33384adc8a80a08add69200b7124c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/OperationDefinition.java

index 0b091e3c9fbdc040f2ecc5dbb7a128d3f0a382e8..30fdefa47c0556fd8d89dc008781041f07215c23 100644 (file)
@@ -8,25 +8,26 @@
 package org.opendaylight.yangtools.yang.model.api;
 
 import java.util.Collection;
-import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.NonNullByDefault;
 
 /**
  * Common interface for an operation, such as an {@link RpcDefinition} or an {@link ActionDefinition}.
  */
+@NonNullByDefault
 public interface OperationDefinition extends SchemaNode {
     /**
      * Returns the set of type definitions declared under this operation.
      *
      * @return Set of type definitions declared under this operation.
      */
-    Collection<? extends @NonNull TypeDefinition<?>> getTypeDefinitions();
+    Collection<? extends TypeDefinition<?>> getTypeDefinitions();
 
     /**
      * Returns the set of grouping statements declared under this operation.
      *
      * @return Set of grouping statements declared under this operation.
      */
-    Collection<? extends @NonNull GroupingDefinition> getGroupings();
+    Collection<? extends GroupingDefinition> getGroupings();
 
     /**
      * Returns definition of input parameters for this operation.
@@ -34,7 +35,7 @@ public interface OperationDefinition extends SchemaNode {
      * @return Definition of input parameters for this operation.
      *         The substatements of input define nodes under the operation's input node.
      */
-    @NonNull InputSchemaNode getInput();
+    InputSchemaNode getInput();
 
     /**
      * Returns definition of output parameters for this operation.
@@ -42,5 +43,5 @@ public interface OperationDefinition extends SchemaNode {
      * @return Definition of output parameters for this operation. The
      *         substatements of output define nodes under the operation's output node.
      */
-    @NonNull OutputSchemaNode getOutput();
+    OutputSchemaNode getOutput();
 }