use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxRegGrouping in project openflowplugin by opendaylight.
the class RegConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxRegGrouping> matchGrouping = MatchUtil.REG_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
NxmNxReg nxmNxReg = matchGrouping.get().getNxmNxReg();
RegValuesBuilder regValuesBuilder = new RegValuesBuilder().setValue(nxmNxReg.getValue()).setMask(nxmNxReg.getMask());
RegCaseValueBuilder regCaseValueBuilder = new RegCaseValueBuilder();
regCaseValueBuilder.setRegValues(regValuesBuilder.build());
return MatchUtil.createDefaultMatchEntryBuilder(nxmNxReg.getReg(), Nxm1Class.class, regCaseValueBuilder.build()).setHasMask(Objects.nonNull(nxmNxReg.getMask())).build();
}
Aggregations