import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.ActionList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction;
-public abstract class AbstractActionInstructionSerializer extends AbstractInstructionSerializer implements
- SerializerRegistryInjector {
+public abstract class AbstractActionInstructionSerializer<T extends Instruction>
+ extends AbstractInstructionSerializer<T> implements SerializerRegistryInjector {
private SerializerRegistry registry;
@Override
- public void serialize(Instruction input, ByteBuf outBuffer) {
+ public void serialize(T input, ByteBuf outBuffer) {
outBuffer.writeShort(getType());
}
* @param startIndex start index of byte buffer
*/
protected void writeActions(ActionList actions, short version, ByteBuf outBuffer, int startIndex) {
- Optional.ofNullable(actions).flatMap(as -> Optional.ofNullable(as.getAction())).map(as -> {
+ Optional.ofNullable(actions).flatMap(as -> Optional.ofNullable(as.nonnullAction())).map(as -> {
final int lengthIndex = outBuffer.writerIndex();
outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);
outBuffer.writeZero(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
- as.stream().sorted(OrderComparator.build()).forEach(a -> ActionUtil
+ as.values().stream().sorted(OrderComparator.build()).forEach(a -> ActionUtil
.writeAction(a.getAction(), version, registry, outBuffer));
outBuffer.setShort(lengthIndex, outBuffer.writerIndex() - startIndex);
return actions;