Migrate EnumTypeDefinition to JDT annotations 13/77213/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Oct 2018 14:10:08 +0000 (16:10 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Oct 2018 14:16:24 +0000 (16:16 +0200)
This is a simple use of @Nonnull, migrate it over along with
all implementations.

Change-Id: Ide74c244134bbe4be62d74945059de486c57bed5
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/type/EnumTypeDefinition.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/BaseEnumerationType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/DerivedEnumerationType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/RestrictedEnumerationType.java

index d8a47296934f079279075095bb282ed298ce04d9..f4e8a1d6b66dd00b4732bd591ccc79c3b4879ded 100644 (file)
@@ -9,18 +9,17 @@ package org.opendaylight.yangtools.yang.model.api.type;
 
 import java.util.List;
 import java.util.Objects;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
 /**
- * Makes is possible to access to the individual enumeration values of this
- * type.
+ * Makes is possible to access to the individual enumeration values of this type.
  */
 public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
     /**
-     * Contains the methods for accessing the data about the concrete
-     * enumeration item which represents <code>enum</code> YANG type.
+     * Contains the methods for accessing the data about the concrete enumeration item which represents {@code enum}
+     * YANG type.
      */
     interface EnumPair extends DocumentedNode.WithStatus {
         /**
@@ -31,9 +30,8 @@ public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
         String getName();
 
         /**
-         * The "value" statement, which is optional, is used to associate an
-         * integer value with the assigned name for the enum. This integer value
-         * MUST be unique within the enumeration type.
+         * The "value" statement, which is optional, is used to associate an integer value with the assigned name
+         * for the enum. This integer value MUST be unique within the enumeration type.
          *
          * @return integer value assigned to enumeration
          */
@@ -43,11 +41,10 @@ public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
     /**
      * Returns all enumeration values.
      *
-     * @return list of <code>EnumPair</code> type instastances which contain the
-     *         data about all individual enumeration pairs of
-     *         <code>enumeration</code> YANG built-in type
+     * @return list of {@code EnumPair} type instances which contain the data about all individual enumeration pairs
+     *         of {@code enumeration} YANG built-in type
      */
-    @Nonnull List<EnumPair> getValues();
+    @NonNull List<EnumPair> getValues();
 
     static boolean equals(final EnumTypeDefinition type, final Object obj) {
         if (type == obj) {
index 496be781696f5033e1daf36a92ced8f6bb87fcb6..46428f86938e4791f8f2a66235f9e2369a32d280 100644 (file)
@@ -10,13 +10,13 @@ package org.opendaylight.yangtools.yang.model.util.type;
 import com.google.common.collect.ImmutableList;
 import java.util.Collection;
 import java.util.List;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
 
 final class BaseEnumerationType extends AbstractBaseType<EnumTypeDefinition> implements EnumTypeDefinition {
-    private final List<EnumPair> values;
+    private final @NonNull List<EnumPair> values;
 
     BaseEnumerationType(final SchemaPath path, final List<UnknownSchemaNode> unknownSchemaNodes,
             final Collection<EnumPair> values) {
@@ -24,7 +24,6 @@ final class BaseEnumerationType extends AbstractBaseType<EnumTypeDefinition> imp
         this.values = ImmutableList.copyOf(values);
     }
 
-    @Nonnull
     @Override
     public List<EnumPair> getValues() {
         return values;
index 26246b6040ca6f19fa53a492730883c20850c089..d3cf3d0b6da06ccbd14c903093c5baf63090e0f2 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.yangtools.yang.model.util.type;
 
 import java.util.Collection;
 import java.util.List;
-import javax.annotation.Nonnull;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.Status;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
@@ -22,7 +21,6 @@ final class DerivedEnumerationType extends AbstractDerivedType<EnumTypeDefinitio
         super(baseType, path, defaultValue, description, reference, status, units, unknownSchemNodes);
     }
 
-    @Nonnull
     @Override
     public List<EnumPair> getValues() {
         return baseType().getValues();
index 354422957b4687ac0874f2694a56c8844e4d8b8c..d22d60f6316be7eadf735e36001d33db3550c35b 100644 (file)
@@ -11,13 +11,13 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import java.util.Collection;
 import java.util.List;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
 
 final class RestrictedEnumerationType extends AbstractRestrictedType<EnumTypeDefinition> implements EnumTypeDefinition {
-    private final List<EnumPair> values;
+    private final @NonNull List<EnumPair> values;
 
     RestrictedEnumerationType(final EnumTypeDefinition baseType, final SchemaPath path,
             final Collection<UnknownSchemaNode> unknownSchemaNodes, final Collection<EnumPair> values) {
@@ -25,7 +25,6 @@ final class RestrictedEnumerationType extends AbstractRestrictedType<EnumTypeDef
         this.values = ImmutableList.copyOf(Preconditions.checkNotNull(values));
     }
 
-    @Nonnull
     @Override
     public List<EnumPair> getValues() {
         return values;