Migrate UsesNode to JDT annotations 17/77217/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Oct 2018 14:38:26 +0000 (16:38 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Oct 2018 14:39:03 +0000 (16:39 +0200)
This is trivial use of @NonNull, migrate it over, along with its
only implementation.

Change-Id: Iab8c40fe5454718db0ac440f03c07b45dcee1806
JIRA: YANGTOOLS-907
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/UsesNode.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/uses/UsesEffectiveStatementImpl.java

index 5d18a93449f34d3416b8b9dd2a5d1ce574fee94b..f8e163cbf186f059bffdb450c2e6d15e5bfb9d21 100644 (file)
@@ -9,34 +9,31 @@ package org.opendaylight.yangtools.yang.model.api;
 
 import java.util.Map;
 import java.util.Set;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.model.api.DocumentedNode.WithStatus;
 
 /**
  * Contains the methods for getting data and checking properties of the YANG <code>uses</code> substatement.
  */
 public interface UsesNode extends WhenConditionAware, WithStatus, CopyableNode {
-
     /**
      * Returns the schema path to used grouping.
      *
      * @return schema path to 'grouping' on which this 'uses' statement points
      */
-    @Nonnull SchemaPath getGroupingPath();
+    @NonNull SchemaPath getGroupingPath();
 
     /**
      * Returns augmentations which were specified in this uses node.
      *
      * @return Set of augment statements defined under this uses node
      */
-    @Nonnull Set<AugmentationSchemaNode> getAugmentations();
+    @NonNull Set<AugmentationSchemaNode> getAugmentations();
 
     /**
-     * Some of the properties of each node in the grouping can be refined with
-     * the "refine" statement.
+     * Some of the properties of each node in the grouping can be refined with the "refine" statement.
      *
-     * @return Map, where key is schema path of refined node and value is
-     *         refined node
+     * @return Map, where key is schema path of refined node and value is refined node
      */
-    @Nonnull Map<SchemaPath, SchemaNode> getRefines();
+    @NonNull Map<SchemaPath, SchemaNode> getRefines();
 }
index bb38cafd3e5bfaee8c9e4e5cc9e28648b543c865..a16b92a94bad287ebcfa69413fd208890123546e 100644 (file)
@@ -18,8 +18,8 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.Set;
-import javax.annotation.Nonnull;
 import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
@@ -41,12 +41,12 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 final class UsesEffectiveStatementImpl extends AbstractEffectiveDocumentedNode<QName, UsesStatement>
         implements UsesEffectiveStatement, UsesNode {
-    private final SchemaPath groupingPath;
+    private final @NonNull SchemaPath groupingPath;
     private final boolean addedByUses;
-    private final Map<SchemaPath, SchemaNode> refines;
-    private final Set<AugmentationSchemaNode> augmentations;
+    private final @NonNull Map<SchemaPath, SchemaNode> refines;
+    private final @NonNull Set<AugmentationSchemaNode> augmentations;
     private final @NonNull List<UnknownSchemaNode> unknownNodes;
-    private final RevisionAwareXPath whenCondition;
+    private final @Nullable RevisionAwareXPath whenCondition;
 
     UsesEffectiveStatementImpl(final StmtContext<QName, UsesStatement, EffectiveStatement<QName, UsesStatement>> ctx) {
         super(ctx);
@@ -85,13 +85,11 @@ final class UsesEffectiveStatementImpl extends AbstractEffectiveDocumentedNode<Q
         whenCondition = findFirstEffectiveSubstatementArgument(WhenEffectiveStatement.class).orElse(null);
     }
 
-    @Nonnull
     @Override
     public SchemaPath getGroupingPath() {
         return groupingPath;
     }
 
-    @Nonnull
     @Override
     public Set<AugmentationSchemaNode> getAugmentations() {
         return augmentations;
@@ -109,19 +107,16 @@ final class UsesEffectiveStatementImpl extends AbstractEffectiveDocumentedNode<Q
         return addedByUses;
     }
 
-    @Nonnull
     @Override
     public Map<SchemaPath, SchemaNode> getRefines() {
         return refines;
     }
 
-    @Nonnull
     @Override
     public List<UnknownSchemaNode> getUnknownSchemaNodes() {
         return unknownNodes;
     }
 
-    @Nonnull
     @Override
     public Optional<RevisionAwareXPath> getWhenCondition() {
         return Optional.ofNullable(whenCondition);