use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfTcpDstGrouping in project openflowplugin by opendaylight.
the class TcpDstConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmOfTcpDstGrouping> matchGrouping = MatchUtil.TCP_DST_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
TcpDstCaseValueBuilder tcpDstCaseValueBuilder = new TcpDstCaseValueBuilder();
TcpDstValuesBuilder tcpDstValuesBuilder = new TcpDstValuesBuilder();
tcpDstValuesBuilder.setPort(matchGrouping.get().getNxmOfTcpDst().getPort());
tcpDstValuesBuilder.setMask(matchGrouping.get().getNxmOfTcpDst().getMask());
tcpDstCaseValueBuilder.setTcpDstValues(tcpDstValuesBuilder.build());
MatchEntryBuilder ofMatch = MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfTcpDst.class, Nxm0Class.class, tcpDstCaseValueBuilder.build());
ofMatch.setHasMask(true);
return ofMatch.build();
}
Aggregations