[ONOS-4115] Support flow table pipeline for REST API

This commit adds capability to handle Table type in
InstructionCodec.

Change-Id: I82f1abf9f7ed17df3885746e8c24223190dd216f
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/DecodeInstructionCodecHelper.java b/core/common/src/main/java/org/onosproject/codec/impl/DecodeInstructionCodecHelper.java
index fbb8c57..105924e 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/DecodeInstructionCodecHelper.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/DecodeInstructionCodecHelper.java
@@ -15,8 +15,7 @@
  */
 package org.onosproject.codec.impl;
 
-import static org.onlab.util.Tools.nullIsIllegal;
-
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.onlab.packet.IpAddress;
 import org.onlab.packet.MacAddress;
 import org.onlab.packet.MplsLabel;
@@ -37,7 +36,7 @@
 import org.onosproject.net.flow.instructions.L3ModificationInstruction;
 import org.onosproject.net.flow.instructions.L4ModificationInstruction;
 
-import com.fasterxml.jackson.databind.node.ObjectNode;
+import static org.onlab.util.Tools.nullIsIllegal;
 
 /**
  * Decoding portion of the instruction codec.
@@ -259,6 +258,9 @@
             return Instructions.createOutput(portNumber);
         } else if (type.equals(Instruction.Type.NOACTION.name())) {
             return Instructions.createNoAction();
+        } else if (type.equals(Instruction.Type.TABLE.name())) {
+            return Instructions.transition(nullIsIllegal(json.get(InstructionCodec.TABLE_ID)
+                    .asInt(), InstructionCodec.TABLE_ID + InstructionCodec.MISSING_MEMBER_MESSAGE));
         } else if (type.equals(Instruction.Type.L0MODIFICATION.name())) {
             return decodeL0();
         } else if (type.equals(Instruction.Type.L1MODIFICATION.name())) {
@@ -273,5 +275,4 @@
         throw new IllegalArgumentException("Instruction type "
                 + type + " is not supported");
     }
-
 }