Hide CodecContext methods
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / AugmentationCodecContext.java
index 2d61c85456e952c376ad49e3fc02e5f31b169a30..484e192f98bc32460ad3ce8d53dd7dc1db087672 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.mdsal.binding.dom.codec.api.BindingAugmentationCodecTree
 import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.DataObjectStep;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
@@ -33,12 +33,12 @@ final class AugmentationCodecContext<D extends DataObject & Augmentation<?>>
 
     private final MethodHandle proxyConstructor;
 
-    private AugmentationCodecContext(final AugmentationCodecPrototype prototype,
+    private AugmentationCodecContext(final AugmentationCodecPrototype<D> prototype,
             final DataContainerAnalysis<AugmentRuntimeType> analysis) {
         super(prototype, analysis);
 
-        final var bindingClass = CodecDataObjectGenerator.generate(prototype.getFactory().getLoader(),
-            prototype.getBindingClass(), analysis.leafContexts, analysis.daoProperties, null);
+        final var bindingClass = CodecDataObjectGenerator.generate(prototype.contextFactory().getLoader(),
+            prototype.javaClass(), analysis.leafContexts, analysis.daoProperties, null);
 
         final MethodHandle ctor;
         try {
@@ -50,20 +50,20 @@ final class AugmentationCodecContext<D extends DataObject & Augmentation<?>>
         proxyConstructor = ctor.asType(DATAOBJECT_TYPE);
     }
 
-    AugmentationCodecContext(final AugmentationCodecPrototype prototype) {
+    AugmentationCodecContext(final AugmentationCodecPrototype<D> prototype) {
         this(prototype, new DataContainerAnalysis<>(prototype, CodecItemFactory.of()));
     }
 
     @Override
-    public PathArgument serializePathArgument(final InstanceIdentifier.PathArgument arg) {
-        if (!bindingArg().equals(arg)) {
-            throw new IllegalArgumentException("Unexpected argument " + arg);
+    public PathArgument serializePathArgument(final DataObjectStep<?> step) {
+        if (!bindingArg().equals(step)) {
+            throw new IllegalArgumentException("Unexpected argument " + step);
         }
         return null;
     }
 
     @Override
-    public InstanceIdentifier.PathArgument deserializePathArgument(final PathArgument arg) {
+    public DataObjectStep<?> deserializePathArgument(final PathArgument arg) {
         if (arg != null) {
             throw new IllegalArgumentException("Unexpected argument " + arg);
         }
@@ -73,7 +73,7 @@ final class AugmentationCodecContext<D extends DataObject & Augmentation<?>>
     @SuppressWarnings("checkstyle:illegalCatch")
     @Override
     public D filterFrom(final DataContainerNode parentData) {
-        for (var childArg : ((AugmentationCodecPrototype) prototype).getChildArgs()) {
+        for (var childArg : ((AugmentationCodecPrototype<?>) prototype()).getChildArgs()) {
             if (parentData.childByArg(childArg) != null) {
                 try {
                     return (D) proxyConstructor.invokeExact(this, parentData);
@@ -92,17 +92,17 @@ final class AugmentationCodecContext<D extends DataObject & Augmentation<?>>
     }
 
     @Override
-    protected Object deserializeObject(final NormalizedNode normalizedNode) {
+    Object deserializeObject(final NormalizedNode normalizedNode) {
         return filterFrom(checkDataArgument(DataContainerNode.class, normalizedNode));
     }
 
     @Override
-    void addYangPathArgument(final List<PathArgument> builder, final InstanceIdentifier.PathArgument arg) {
+    void addYangPathArgument(final List<PathArgument> builder, final DataObjectStep<?> step) {
         // No-op
     }
 
     @Override
-    protected NodeIdentifier getDomPathArgument() {
+    NodeIdentifier getDomPathArgument() {
         return null;
     }