use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxTunIpv4SrcGrouping in project openflowplugin by opendaylight.
the class TunIPv4SrcConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxTunIpv4SrcGrouping> matchGrouping = MatchUtil.TUN_IPV4_SRC_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Ipv4Address value = matchGrouping.get().getNxmNxTunIpv4Src().getIpv4Address();
TunIpv4SrcCaseValueBuilder tunIpv4SrcCaseValueBuilder = new TunIpv4SrcCaseValueBuilder();
tunIpv4SrcCaseValueBuilder.setTunIpv4SrcValues(new TunIpv4SrcValuesBuilder().setValue(MatchUtil.ipv4ToLong(value)).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunIpv4Src.class, Nxm1Class.class, tunIpv4SrcCaseValueBuilder.build()).build();
}
Aggregations