Rename CaseNodeCodecContext 29/106729/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 27 Jun 2023 22:06:41 +0000 (00:06 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 27 Jun 2023 22:25:19 +0000 (00:25 +0200)
'CaseCodecContext' is a better name, matching the CaseCodecPrototype we
already have.

Change-Id: I5b3f8501e92f65824d63da282b54b10751424208
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/BindingCodecContext.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/BindingToNormalizedStreamWriter.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/CaseCodecContext.java [moved from binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/CaseNodeCodecContext.java with 91% similarity]
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/CaseCodecPrototype.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/ChoiceCodecContext.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/DataObjectCodecContext.java

index 9e29114da4c3a728d7e3aca5ec87f827a39c6d6d..ef9687dc0135b7148c6e94cba03cb8f52c175fc3 100644 (file)
@@ -317,7 +317,7 @@ public final class BindingCodecContext extends AbstractBindingNormalizedNodeSeri
             LOG.debug("Instance identifier targeting a choice is not representable ({})", dom);
             return null;
         }
-        if (currentNode instanceof CaseNodeCodecContext) {
+        if (currentNode instanceof CaseCodecContext) {
             LOG.debug("Instance identifier targeting a case is not representable ({})", dom);
             return null;
         }
index d2a88f7626bef56fc05aaaa54d66dff73122014b..d4b8aedda2f50c80cf51e2c1694f300124939bbf 100644 (file)
@@ -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();
         }
     }
@@ -17,8 +17,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
-final class CaseNodeCodecContext<D extends DataObject> extends DataObjectCodecContext<D, CaseRuntimeType> {
-    CaseNodeCodecContext(final CaseCodecPrototype prototype) {
+final class CaseCodecContext<D extends DataObject> extends DataObjectCodecContext<D, CaseRuntimeType> {
+    CaseCodecContext(final CaseCodecPrototype prototype) {
         super(prototype, CodecItemFactory.of(prototype.getBindingClass()));
     }
 
index 351c0d2f854114e9d06f9e25a31b46f3dc35b217..762637e47b17e790b57ab5a225d17631ccd6c8f8 100644 (file)
@@ -16,7 +16,7 @@ final class CaseCodecPrototype extends DataObjectCodecPrototype<CaseRuntimeType>
     }
 
     @Override
-    CaseNodeCodecContext<?> createInstance() {
-        return new CaseNodeCodecContext<>(this);
+    CaseCodecContext<?> createInstance() {
+        return new CaseCodecContext<>(this);
     }
 }
\ No newline at end of file
index b2f443d8d346a4f49d8ed7d0c0eb8f23fc750096..c73a47f6915d69062e38e5b10cb3dff03b083e06 100644 (file)
@@ -250,7 +250,7 @@ final class ChoiceCodecContext<D extends DataObject> extends DataContainerCodecC
             return null;
         }
         final var caze = byYangCaseChild.get(first.name());
-        return ((CaseNodeCodecContext<D>) caze.get()).deserialize(data);
+        return ((CaseCodecContext<D>) caze.get()).deserialize(data);
     }
 
     @Override
index c2fa64c67cc2fc7bb19efb15b1e58c95e4dbec4c..765fb6dc7e63d018162d776ef50aab7bb1469f14 100644 (file)
@@ -48,7 +48,7 @@ import org.slf4j.LoggerFactory;
 @Beta
 public abstract sealed class DataObjectCodecContext<D extends DataObject, T extends CompositeRuntimeType>
         extends AbstractDataObjectCodecContext<D, T> implements BindingDataObjectCodecTreeNode<D>
-        permits CaseNodeCodecContext, ContainerLikeCodecContext, ListCodecContext, NotificationCodecContext {
+        permits CaseCodecContext, ContainerLikeCodecContext, ListCodecContext, NotificationCodecContext {
     private static final Logger LOG = LoggerFactory.getLogger(DataObjectCodecContext.class);
 
     private static final VarHandle MISMATCHED_AUGMENTED;