Search in sources :

Example 1 with NxActionRegLoadGrouping

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());
}
Also used : Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.Dst) NxActionRegLoadGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionRegLoadGrouping) ActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoadBuilder) NxActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder) NxActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder)

Aggregations

ActionRegLoadBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoadBuilder)1 NxActionRegLoadBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder)1 NxActionRegLoadGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionRegLoadGrouping)1 Dst (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.Dst)1