Fix a bug when creating FlowId and FlowBatchId from hex string:

 * Added static methods FlowId.valueOf(String) and FlowBatchId.valueOf(String)
   Implementation-wise, those methods are practically same as
   IntentId.valueOf(String)

 * Used the above methods as appropriate.

This fixes an exception that for some reason only occasionally shows-up
in logs of some of the unit tests, and also does not break those tests.

Also, make the change to accept hex strings starting with either 0x or 0X.

Change-Id: Iaaee529866deb1a89ccc3f306901672f25be6326
diff --git a/src/main/java/net/onrc/onos/api/newintent/IntentId.java b/src/main/java/net/onrc/onos/api/newintent/IntentId.java
index ebe1b45..4552187 100644
--- a/src/main/java/net/onrc/onos/api/newintent/IntentId.java
+++ b/src/main/java/net/onrc/onos/api/newintent/IntentId.java
@@ -21,7 +21,7 @@
      * @return intent identifier
      */
     public static IntentId valueOf(String value) {
-        long id = value.startsWith("0x")
+        long id = value.toLowerCase().startsWith("0x")
                 ? Long.parseLong(value.substring(2), HEX)
                 : Long.parseLong(value, DEC);
         return new IntentId(id);