Fix checkstyle in mdsal-binding2-dom-codec
[mdsal.git] / binding2 / mdsal-binding2-dom-codec / src / main / java / org / opendaylight / mdsal / binding / javav2 / dom / codec / impl / serializer / CachingNormalizedNodeSerializer.java
index 0f36bdacd2addef7888bb9b94c7a2bb2f7a64f43..0fd479c1baead23925055c75a9df6a78ceccbf90 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult;
  * Serializer of Binding objects to Normalized Node which uses
  * {@link BindingNormalizedNodeCache} to cache already serialized values.
  *
+ * <p>
  * This serializer implements {@link BindingStreamEventWriter} along with
  * {@link BindingSerializer}.
  *
@@ -60,12 +61,14 @@ public final class CachingNormalizedNodeSerializer extends ForwardingBindingStre
     /**
      * Serializes input if it is cached, returns null otherwise.
      *
+     * <p>
      * If input is cached it uses
      * {@link NormalizedNodeWithAddChildWriter#addChild(NormalizedNode)} to
      * provide already serialized value to underlying NormalizedNodeWriter in
      * order to reuse value instead of creating new one using Normalized Node
      * stream APIs.
      *
+     * <p>
      * Note that this optional is serialization of child node invoked from
      * {@link TreeNodeSerializer}, which may opt-out from streaming of data when
      * non-null result is returned.
@@ -81,18 +84,6 @@ public final class CachingNormalizedNodeSerializer extends ForwardingBindingStre
         return null;
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    private BindingNormalizedNodeCache getCacheSerializer(final Class type) {
-        if (cacheHolder.isCached(type)) {
-            final DataContainerCodecContext<?, ?> currentCtx = (DataContainerCodecContext<?, ?>) delegate.current();
-            if (type.equals(currentCtx.getBindingClass())) {
-                return cacheHolder.getCachingSerializer(currentCtx);
-            }
-            return cacheHolder.getCachingSerializer(currentCtx.streamChild(type));
-        }
-        return null;
-    }
-
     /**
      * Serializes supplied data using stream writer with child cache enabled or
      * using cache directly if cache is avalaible also for supplied Codec node.
@@ -114,6 +105,18 @@ public final class CachingNormalizedNodeSerializer extends ForwardingBindingStre
         return serializeUsingStreamWriter(cacheHolder, subtreeRoot, data);
     }
 
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    private BindingNormalizedNodeCache getCacheSerializer(final Class type) {
+        if (cacheHolder.isCached(type)) {
+            final DataContainerCodecContext<?, ?> currentCtx = (DataContainerCodecContext<?, ?>) delegate.current();
+            if (type.equals(currentCtx.getBindingClass())) {
+                return cacheHolder.getCachingSerializer(currentCtx);
+            }
+            return cacheHolder.getCachingSerializer(currentCtx.streamChild(type));
+        }
+        return null;
+    }
+
     /**
      * Serializes supplied data using stream writer with child cache enabled.
      *