Deprecate Types.augmentableTypeFor() 67/86467/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 18 Dec 2019 08:48:31 +0000 (09:48 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 18 Dec 2019 08:48:31 +0000 (09:48 +0100)
This method has a mirror in BindingTypes, which is a more appropriate
place for the definition. Deprecate the method for removal and
redirect it to BindingTypes.augmentation().

Change-Id: I462a2fe25f0b53cca0619c72aac7a1e602718143
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/BindingTypes.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/Types.java

index 3bb4e824d14a0981ec7abdf405b0188e332faa2d..903740e53c8c2619f3c1ee5023876b3b8f08bd4c 100644 (file)
@@ -11,6 +11,7 @@ import static org.opendaylight.mdsal.binding.model.util.Types.parameterizedTypeF
 import static org.opendaylight.mdsal.binding.model.util.Types.typeForClass;
 
 import com.google.common.annotations.VisibleForTesting;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.model.api.ConcreteType;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.ParameterizedType;
@@ -141,7 +142,7 @@ public final class BindingTypes {
      * @return A parameterized type corresponding to {@code Augmentable<Type>}
      * @throws NullPointerException if {@code type} is null
      */
-    public static ParameterizedType augmentable(final Type type) {
+    public static @NonNull ParameterizedType augmentable(final Type type) {
         return parameterizedTypeFor(AUGMENTABLE, type);
     }
 
index 9f7351e9d0cdd6a77e3adfac6094b525d8c10def..99137a927204290eb05c72a028100da4a0892792 100644 (file)
@@ -34,7 +34,6 @@ import org.opendaylight.mdsal.binding.model.api.Restrictions;
 import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.api.WildcardType;
 import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
 import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint;
@@ -65,7 +64,6 @@ public final class Types {
     private static final @NonNull ConcreteType SERIALIZABLE = typeForClass(Serializable.class);
     private static final @NonNull ConcreteType SET_TYPE = typeForClass(Set.class);
 
-    private static final @NonNull ConcreteType AUGMENTABLE = typeForClass(Augmentable.class);
     private static final @NonNull ConcreteType AUGMENTATION = typeForClass(Augmentation.class);
 
     /**
@@ -249,9 +247,11 @@ public final class Types {
      * @return <code>ParametrizedType</code> representation of raw type
      *         <code>Augmentable</code> with actual parameter
      *         <code>valueType</code>
+     * @deprecated Use {@link BindingTypes#augmentable(Type)} instead.
      */
+    @Deprecated(forRemoval = true)
     public static @NonNull ParameterizedType augmentableTypeFor(final Type valueType) {
-        return parameterizedTypeFor(AUGMENTABLE, valueType);
+        return BindingTypes.augmentable(valueType);
     }
 
     /**