Reorganize AbstractNormalizedNodeDataOutput
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / stream / NeonSR2NormalizedNodeOutputStreamWriter.java
index e25aab5a72ae7fc2b4890725d9e0b5b72c9e36a7..43bcc3452369ced145ec1d363cf672f2022c506b 100644 (file)
@@ -29,7 +29,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.Augmentat
  * <p>Based on the each node, the node type is also written to the stream, that helps in reconstructing the object,
  * while reading.
  */
-class NeonSR2NormalizedNodeOutputStreamWriter extends LithiumNormalizedNodeOutputStreamWriter {
+final class NeonSR2NormalizedNodeOutputStreamWriter extends AbstractLithiumDataOutput {
     private final Map<AugmentationIdentifier, Integer> aidCodeMap = new HashMap<>();
     private final Map<QNameModule, Integer> moduleCodeMap = new HashMap<>();
     private final Map<QName, Integer> qnameCodeMap = new HashMap<>();
@@ -39,18 +39,18 @@ class NeonSR2NormalizedNodeOutputStreamWriter extends LithiumNormalizedNodeOutpu
     }
 
     @Override
-    protected short streamVersion() {
+    short streamVersion() {
         return TokenTypes.NEON_SR2_VERSION;
     }
 
     @Override
-    public final void writeQName(final QName qname) throws IOException {
+    void writeQNameInternal(final QName qname) throws IOException {
         final Integer value = qnameCodeMap.get(qname);
         if (value == null) {
             // Fresh QName, remember it and emit as three strings
             qnameCodeMap.put(qname, qnameCodeMap.size());
             writeByte(TokenTypes.IS_QNAME_VALUE);
-            super.writeQName(qname);
+            defaultWriteQName(qname);
         } else {
             // We have already seen this QName: write its code
             writeByte(TokenTypes.IS_QNAME_CODE);
@@ -65,7 +65,7 @@ class NeonSR2NormalizedNodeOutputStreamWriter extends LithiumNormalizedNodeOutpu
             // Fresh AugmentationIdentifier, remember it and emit as three strings
             aidCodeMap.put(aid, aidCodeMap.size());
             writeByte(TokenTypes.IS_AUGMENT_VALUE);
-            super.writeAugmentationIdentifier(aid);
+            defaultWriteAugmentationIdentifier(aid);
         } else {
             // We have already seen this AugmentationIdentifier: write its code
             writeByte(TokenTypes.IS_AUGMENT_CODE);
@@ -80,7 +80,7 @@ class NeonSR2NormalizedNodeOutputStreamWriter extends LithiumNormalizedNodeOutpu
             // Fresh QNameModule, remember it and emit as three strings
             moduleCodeMap.put(module, moduleCodeMap.size());
             writeByte(TokenTypes.IS_MODULE_VALUE);
-            super.writeModule(module);
+            defaultWriteModule(module);
         } else {
             // We have already seen this QNameModule: write its code
             writeByte(TokenTypes.IS_MODULE_CODE);