Bump upstreams
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / action / OF10SetNwDstActionSerializer.java
index a0f9f53f2f6cf546258da2ebf14b404625b9b7c4..e29a1acd46cd78173de03fe0126b6f7901f4a756 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 
 import io.netty.buffer.ByteBuf;
@@ -15,25 +14,18 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 
 /**
- * @author michal.polkorab
+ * Serializes OF 1.0 SetNwDst actions.
  *
+ * @author michal.polkorab
  */
 public class OF10SetNwDstActionSerializer extends AbstractActionSerializer {
-
-    @Override
-    public void serialize(final Action action, final ByteBuf outBuffer) {
-        super.serialize(action, outBuffer);
-        outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(
-            ((SetNwDstCase) action.getActionChoice()).getSetNwDstAction().getIpAddress()));
+    public OF10SetNwDstActionSerializer() {
+        super(ActionConstants.SET_NW_DST_CODE, ActionConstants.GENERAL_ACTION_LENGTH);
     }
 
     @Override
-    protected int getType() {
-        return ActionConstants.SET_NW_DST_CODE;
-    }
-
-    @Override
-    protected int getLength() {
-        return ActionConstants.GENERAL_ACTION_LENGTH;
+    protected void serializeBody(final Action action, final ByteBuf outBuffer) {
+        outBuffer.writeBytes(IetfInetUtil.ipv4AddressBytes(
+            ((SetNwDstCase) action.getActionChoice()).getSetNwDstAction().getIpAddress()));
     }
 }