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/FlowEntryId.java b/src/main/java/net/floodlightcontroller/util/FlowEntryId.java
index bf1fc7d..0874bdb 100644
--- a/src/main/java/net/floodlightcontroller/util/FlowEntryId.java
+++ b/src/main/java/net/floodlightcontroller/util/FlowEntryId.java
@@ -1,13 +1,16 @@
package net.floodlightcontroller.util;
+import net.floodlightcontroller.util.serializers.FlowEntryIdDeserializer;
import net.floodlightcontroller.util.serializers.FlowEntryIdSerializer;
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 Entry ID.
*/
+@JsonDeserialize(using=FlowEntryIdDeserializer.class)
@JsonSerialize(using=FlowEntryIdSerializer.class)
public class FlowEntryId {
private long value;
@@ -29,6 +32,15 @@
}
/**
+ * Constructor from a string.
+ *
+ * @param value the value to use.
+ */
+ public FlowEntryId(String value) {
+ this.value = Long.decode(value);
+ }
+
+ /**
* Get the value of the Flow Entry ID.
*
* @return the value of the Flow Entry ID.