Update MRI projects for Aluminium
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / protocol / serialization / instructions / AbstractActionInstructionSerializer.java
index 393f6bfc90b15a152f085479c21cb67ef8ef2744..c67ee0e627fe1f68238a1de491f2531d8f0f79bb 100644 (file)
@@ -19,13 +19,13 @@ import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.Ord
 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());
     }
 
@@ -37,11 +37,11 @@ public abstract class AbstractActionInstructionSerializer extends AbstractInstru
      * @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;