Leftover follow-up commit for "1c8f47754241fea8b9c1463c08539ec31638a5de":
* Use the "@JsonProperty()" annotation to serialize/deserialize
objects that don't require any specialized processing.
Use "@JsonSerialize" and "@JsonDeserialize" only for objects
that need more specialized processing.
* Remove FooSerializer JSON classes that are not used/needed anymore.
* Update the implementation of remaining FooSerializer classes,
and associated Foo classes.
diff --git a/src/main/java/net/floodlightcontroller/util/FlowId.java b/src/main/java/net/floodlightcontroller/util/FlowId.java
index a8beaa0..297c0c4 100644
--- a/src/main/java/net/floodlightcontroller/util/FlowId.java
+++ b/src/main/java/net/floodlightcontroller/util/FlowId.java
@@ -1,13 +1,16 @@
package net.floodlightcontroller.util;
+import net.floodlightcontroller.util.serializers.FlowIdDeserializer;
import net.floodlightcontroller.util.serializers.FlowIdSerializer;
import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
* The class representing a Flow ID.
*/
+@JsonDeserialize(using=FlowIdDeserializer.class)
@JsonSerialize(using=FlowIdSerializer.class)
public class FlowId {
private long value;
@@ -29,6 +32,15 @@
}
/**
+ * Constructor from a string.
+ *
+ * @param value the value to use.
+ */
+ public FlowId(String value) {
+ this.value = Long.decode(value);
+ }
+
+ /**
* Get the value of the Flow ID.
*
* @return the value of the Flow ID.