use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxCtStateGrouping in project openflowplugin by opendaylight.
the class CtStateConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxCtStateGrouping> matchGrouping = MatchUtil.CT_STATE_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
CtStateCaseValueBuilder ctStateCaseValueBuilder = new CtStateCaseValueBuilder();
CtStateValuesBuilder ctStateValuesBuilder = new CtStateValuesBuilder();
ctStateValuesBuilder.setCtState(matchGrouping.get().getNxmNxCtState().getCtState());
ctStateValuesBuilder.setMask(matchGrouping.get().getNxmNxCtState().getMask());
ctStateCaseValueBuilder.setCtStateValues(ctStateValuesBuilder.build());
MatchEntryBuilder ofMatch = MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtState.class, Nxm1Class.class, ctStateCaseValueBuilder.build());
ofMatch.setHasMask(true);
return ofMatch.build();
}
Aggregations