* 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;
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()));
}
}