use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfUdpSrcGrouping in project openflowplugin by opendaylight.
the class UdpSrcConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmOfUdpSrcGrouping> matchGrouping = MatchUtil.UDP_SRC_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
UdpSrcCaseValueBuilder udpSrcCaseValueBuilder = new UdpSrcCaseValueBuilder();
UdpSrcValuesBuilder udpSrcValuesBuilder = new UdpSrcValuesBuilder();
udpSrcValuesBuilder.setPort(matchGrouping.get().getNxmOfUdpSrc().getPort());
udpSrcValuesBuilder.setMask(matchGrouping.get().getNxmOfUdpSrc().getMask());
udpSrcCaseValueBuilder.setUdpSrcValues(udpSrcValuesBuilder.build());
MatchEntryBuilder ofMatch = MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfUdpSrc.class, Nxm0Class.class, udpSrcCaseValueBuilder.build());
ofMatch.setHasMask(true);
return ofMatch.build();
}
Aggregations