Bump mdsal to 5.0.2
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / protocol / serialization / actions / SetNwTtlActionSerializer.java
index db93e8ed54a5d33668a5df6b1b5e11a6fa751731..d084b90c22b4cadebcfc69c1a4237927a8beecd6 100644 (file)
@@ -10,16 +10,15 @@ package org.opendaylight.openflowplugin.impl.protocol.serialization.actions;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.ttl.action._case.SetNwTtlAction;
 
-public class SetNwTtlActionSerializer extends AbstractActionSerializer {
+public class SetNwTtlActionSerializer extends AbstractActionSerializer<SetNwTtlActionCase> {
     @Override
-    public void serialize(Action action, ByteBuf outBuffer) {
+    public void serialize(final SetNwTtlActionCase action, final ByteBuf outBuffer) {
         super.serialize(action, outBuffer);
-        final SetNwTtlAction setNwTtlAction = SetNwTtlActionCase.class.cast(action).getSetNwTtlAction();
-        outBuffer.writeByte(setNwTtlAction.getNwTtl());
+        final SetNwTtlAction setNwTtlAction = action.getSetNwTtlAction();
+        outBuffer.writeByte(setNwTtlAction.getNwTtl().toJava());
         outBuffer.writeZero(ActionConstants.SET_NW_TTL_PADDING);
     }