* Added JsonSerialize to the Flow-related containers.
* Implement the remaining toString() methods that were
returning empty strings.
diff --git a/src/main/java/net/floodlightcontroller/util/FlowId.java b/src/main/java/net/floodlightcontroller/util/FlowId.java
index 827c1d9..a8beaa0 100644
--- a/src/main/java/net/floodlightcontroller/util/FlowId.java
+++ b/src/main/java/net/floodlightcontroller/util/FlowId.java
@@ -1,8 +1,14 @@
package net.floodlightcontroller.util;
+import net.floodlightcontroller.util.serializers.FlowIdSerializer;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
/**
* The class representing a Flow ID.
*/
+@JsonSerialize(using=FlowIdSerializer.class)
public class FlowId {
private long value;
@@ -39,14 +45,12 @@
}
/**
- * Convert the Flow ID value to a string.
+ * Convert the Flow ID value to a hexadecimal string.
*
- * @return the Flow ID value to a string.
+ * @return the Flow ID value to a hexadecimal string.
*/
@Override
public String toString() {
- String ret = "";
- // TODO: Implement it!
- return ret;
+ return "0x" + Long.toHexString(this.value);
}
}