Make AugmentationCodecPrototype generic
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / AugmentationCodecPrototype.java
index 5f10f1abc5d8e6321da7a9aa781f2eb58ff2523a..1b5ae222f661a6dbaa0cb1829635fdd329473c79 100644 (file)
@@ -12,17 +12,17 @@ import static java.util.Objects.requireNonNull;
 import com.google.common.collect.ImmutableSet;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType;
-import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.binding.NodeStep;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 
-final class AugmentationCodecPrototype extends CommonDataObjectCodecPrototype<AugmentRuntimeType> {
+final class AugmentationCodecPrototype<T extends Augmentation<?>>
+        extends CommonDataObjectCodecPrototype<AugmentRuntimeType> {
     private final @NonNull ImmutableSet<NodeIdentifier> childArgs;
 
-    @SuppressWarnings("unchecked")
-    AugmentationCodecPrototype(final @NonNull Class<?> cls, final AugmentRuntimeType type,
+    AugmentationCodecPrototype(final @NonNull Class<T> cls, final AugmentRuntimeType type,
             final CodecContextFactory factory, final ImmutableSet<NodeIdentifier> childArgs) {
-        super(new NodeStep<>((Class<? extends DataObject>) cls), type, factory);
+        super(new NodeStep<>(cls), type, factory);
         this.childArgs = requireNonNull(childArgs);
     }