Allows to specify matches, action parameters as strings in PI

Some PI elements can encode in their value a string (e.g., when
a P4Runtime translation is used), for this reason we allow users
to specify matches and action parameters as strings.
From southbound, during decode, we interpret the elements as
string if the P4 model suggests that.

Change-Id: I5884de1500437ab647abc200d65de442e23bd1a8
diff --git a/core/api/src/main/java/org/onosproject/net/flow/criteria/PiCriterion.java b/core/api/src/main/java/org/onosproject/net/flow/criteria/PiCriterion.java
index 3970e76..43a5bdf 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/criteria/PiCriterion.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/criteria/PiCriterion.java
@@ -195,6 +195,18 @@
         }
 
         /**
+         * Adds an exact field match for the given fieldId and value.
+         *
+         * @param fieldId protocol-independent header field Id
+         * @param value   exact match value
+         * @return this
+         */
+        public Builder matchExact(PiMatchFieldId fieldId, String value) {
+            fieldMatchMapBuilder.put(fieldId, new PiExactFieldMatch(fieldId, copyFrom(value)));
+            return this;
+        }
+
+        /**
          * Adds a ternary field match for the given fieldId, value and mask.
          *
          * @param fieldId protocol-independent header field Id
@@ -399,6 +411,18 @@
         }
 
         /**
+         * Adds an optional field match for the given fieldId and value.
+         *
+         * @param fieldId protocol-independent header field Id
+         * @param value   optional match value
+         * @return this
+         */
+        public Builder matchOptional(PiMatchFieldId fieldId, String value) {
+            fieldMatchMapBuilder.put(fieldId, new PiOptionalFieldMatch(fieldId, copyFrom(value)));
+            return this;
+        }
+
+        /**
          * Builds a PiCriterion.
          *
          * @return PiCriterion
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionParam.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionParam.java
index a8d565c..91f6e04 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionParam.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionParam.java
@@ -104,6 +104,17 @@
     }
 
     /**
+     * Creates an action's runtime parameter for the given param ID and string
+     * value.
+     *
+     * @param id    parameter identifier
+     * @param value value
+     */
+    public PiActionParam(PiActionParamId id, String value) {
+        this(id, copyFrom(value));
+    }
+
+    /**
      * Returns the identifier of this parameter.
      *
      * @return parameter identifier