use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder in project openflowplugin by opendaylight.
the class OfToSalSetMplsTtlCase method process.
@Override
public Optional<Action> process(@Nonnull final SetMplsTtlCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
SetMplsTtlAction setMplsTtlActionFromOF = source.getSetMplsTtlAction();
SetMplsTtlActionBuilder mplsTtlAction = new SetMplsTtlActionBuilder();
mplsTtlAction.setMplsTtl(setMplsTtlActionFromOF.getMplsTtl());
return Optional.of(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(mplsTtlAction.build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder in project openflowplugin by opendaylight.
the class SetMplsTtlActionSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final short mpls = (short) 10;
final Action action = new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(new SetMplsTtlActionBuilder().setMplsTtl(mpls).build()).build();
assertAction(action, out -> {
assertEquals(out.readUnsignedByte(), mpls);
out.skipBytes(ActionConstants.SET_MPLS_TTL_PADDING);
});
}
Aggregations