Deprecate DataObjectReadingUtil
[mdsal.git] / binding / mdsal-binding-spec-util / src / main / java / org / opendaylight / mdsal / binding / spec / util / DataObjectReadingUtil.java
index 67178c8e726b78fb430d381588cd0c9f7cae5bab..1d8f64af7734d05e441a814af3aa286c5aec0e2b 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.mdsal.binding.spec.util;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
 
-import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap.Builder;
 import java.lang.reflect.InvocationTargetException;
@@ -34,9 +33,8 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableIt
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.Item;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
 
-@Beta
+@Deprecated(since = "11.0.3", forRemoval = true)
 public final class DataObjectReadingUtil {
-
     private static final DataObjectReadingStrategy REAUSABLE_AUGMENTATION_READING_STRATEGY =
             new AugmentationReadingStrategy();
 
@@ -146,14 +144,14 @@ public final class DataObjectReadingUtil {
             checkArgument(DataContainer.class.isAssignableFrom(childType));
             this.parentType = parentType;
             this.childType = childType;
-            this.getterMethod = resolveGetterMethod(parentType, childType);
+            getterMethod = resolveGetterMethod(parentType, childType);
         }
 
         @SuppressWarnings("unchecked")
         DataObjectReadingStrategy(final Class parentType, final Class childType, final Method getter) {
             this.parentType = parentType;
             this.childType = childType;
-            this.getterMethod = getter;
+            getterMethod = getter;
         }
 
         @SuppressWarnings("unused")
@@ -302,14 +300,11 @@ public final class DataObjectReadingUtil {
         }
 
         @Override
+        @SuppressWarnings({ "rawtypes", "unchecked" })
         public DataContainer read(final DataContainer parent, final Class<?> child) {
             checkArgument(Augmentation.class.isAssignableFrom(child), "Child must be Augmentation.");
             checkArgument(parent instanceof Augmentable<?>, "Parent must be Augmentable.");
-
-            @SuppressWarnings({ "rawtypes", "unchecked" })
-            Augmentation potential = ((Augmentable) parent).augmentation(child);
-            checkState(potential instanceof DataContainer, "Readed augmention must be data object");
-            return (DataContainer) potential;
+            return ((Augmentable) parent).augmentation(child);
         }
     }