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;
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();
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")
}
@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);
}
}