import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.TcpFlagsContainer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.oxm.container.match.entry.value.experimenter.id._case.TcpFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.tcp.flags.container.TcpFlags;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.experimenter.id.match.entry.ExperimenterIdCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
* Created by Anil Vishnoi (avishnoi@Brocade.com) on 7/25/16.
public class OnfOxmTcpFlagsSerializer extends AbstractOxmExperimenterMatchEntrySerializer {
@Override
- public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ public void serialize(final MatchEntry entry, final ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
ExperimenterIdCase expCase = serializeExperimenterId(entry, outBuffer);
- TcpFlags tcpFlags = expCase.getAugmentation(TcpFlagsContainer.class).getTcpFlags();
- outBuffer.writeShort(tcpFlags.getFlags());
- if (entry.isHasMask()) {
+ TcpFlags tcpFlags = expCase.augmentation(TcpFlagsContainer.class).getTcpFlags();
+ outBuffer.writeShort(tcpFlags.getFlags().toJava());
+ if (entry.getHasMask()) {
outBuffer.writeBytes(tcpFlags.getMask());
}
}
/**
- * @return Experimenter match entry ID
+ * Returns the Experimenter match entry ID.
*/
@Override
- protected long getExperimenterId() {
+ protected Uint32 getExperimenterId() {
return EncodeConstants.ONF_EXPERIMENTER_ID;
}
/**
- * @return numeric representation of oxm_field
+ * Returns the numeric representation of oxm_field.
*/
@Override
protected int getOxmFieldCode() {
}
/**
- * @return numeric representation of oxm_class
+ * Returns the numeric representation of oxm_class.
*/
@Override
protected int getOxmClassCode() {
}
/**
- * @return match entry value length (without mask length)
+ * Returns the match entry value length (without mask length).
*/
@Override
protected int getValueLength() {
- return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+ return Short.BYTES;
}
}