Retain protype in DataContainerCodecContext
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / BindingToNormalizedStreamWriter.java
index 61885141bf607c7ad2ceba51ac22207d89b9aaa1..7ae433121825ed9b304cb44375bdcbd139a2c9d6 100644 (file)
@@ -37,7 +37,7 @@ final class BindingToNormalizedStreamWriter implements AnydataBindingStreamWrite
     private final @NonNull NormalizedNodeStreamWriter delegate;
     private final CodecContext rootContext;
 
-    BindingToNormalizedStreamWriter(final DataContainerCodecContext<?, ?> rootContext,
+    BindingToNormalizedStreamWriter(final DataContainerCodecContext<?, ?, ?> rootContext,
             final NormalizedNodeStreamWriter delegate) {
         this.rootContext = requireNonNull(rootContext);
         this.delegate = requireNonNull(delegate);
@@ -71,7 +71,7 @@ final class BindingToNormalizedStreamWriter implements AnydataBindingStreamWrite
         if (current == null) {
             // Entry of first node
             next = rootContext;
-        } else if (current instanceof DataContainerCodecContext<?, ?> currentContainer) {
+        } else if (current instanceof DataContainerCodecContext<?, ?, ?> currentContainer) {
             next = currentContainer.getStreamChild((Class) name);
         } else {
             throw new IllegalArgumentException("Could not start node " + name + " in non-container " + current);
@@ -97,7 +97,7 @@ final class BindingToNormalizedStreamWriter implements AnydataBindingStreamWrite
         CodecContext left = schema.pop();
         // Due to writer does not start a new node on startCase() and on startAugmentationNode()
         // node ending should not be triggered when associated endNode() is invoked.
-        if (!(left instanceof CaseNodeCodecContext) && !(left instanceof AugmentationCodecContext)) {
+        if (!(left instanceof CaseCodecContext) && !(left instanceof AugmentationCodecContext)) {
             delegate.endNode();
         }
     }
@@ -188,7 +188,7 @@ final class BindingToNormalizedStreamWriter implements AnydataBindingStreamWrite
     @Override
     public void startMapEntryNode(final Key<?> key, final int childSizeHint) throws IOException {
         duplicateSchemaEnter();
-        NodeIdentifierWithPredicates identifier = ((KeyedListNodeCodecContext<?, ?>) current()).serialize(key);
+        NodeIdentifierWithPredicates identifier = ((MapCodecContext<?, ?>) current()).serialize(key);
         delegate.startMapEntryNode(identifier, childSizeHint);
     }