use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionRegLoadGrouping in project openflowplugin by opendaylight.
the class RegLoadConvertor method convert.
@Override
public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
Preconditions.checkArgument(nxActionArg instanceof NxActionRegLoadGrouping);
NxActionRegLoadGrouping nxAction = (NxActionRegLoadGrouping) nxActionArg;
Dst dst = nxAction.getNxRegLoad().getDst();
final ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
nxActionRegLoadBuilder.setDst(RegMoveConvertor.resolveDst(dst.getDstChoice()));
nxActionRegLoadBuilder.setOfsNbits(dst.getStart() << 6 | dst.getEnd() - dst.getStart());
nxActionRegLoadBuilder.setValue(nxAction.getNxRegLoad().getValue());
actionRegLoadBuilder.setNxActionRegLoad(nxActionRegLoadBuilder.build());
return ActionUtil.createAction(actionRegLoadBuilder.build());
}
Aggregations