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/IPv6.java b/src/main/java/net/floodlightcontroller/util/IPv6.java
index d4461c0..eda4502 100644
--- a/src/main/java/net/floodlightcontroller/util/IPv6.java
+++ b/src/main/java/net/floodlightcontroller/util/IPv6.java
@@ -1,14 +1,17 @@
package net.floodlightcontroller.util;
import org.openflow.util.HexString;
+import net.floodlightcontroller.util.serializers.IPv6Deserializer;
import net.floodlightcontroller.util.serializers.IPv6Serializer;
import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
* The class representing an IPv6 address.
*/
+@JsonDeserialize(using=IPv6Deserializer.class)
@JsonSerialize(using=IPv6Serializer.class)
public class IPv6 {
private long valueHigh; // The higher (more significant) 64 bits
@@ -34,6 +37,17 @@
}
/**
+ * Constructor from a string.
+ *
+ * @param value the value to use.
+ */
+ public IPv6(String value) {
+ // TODO: Implement it!
+ this.valueHigh = 0;
+ this.valueLow = 0;
+ }
+
+ /**
* Get the value of the higher (more significant) 64 bits of the address.
*
* @return the value of the higher (more significant) 64 bits of the
@@ -42,6 +56,15 @@
public long valueHigh() { return valueHigh; }
/**
+ * Set the value of the higher (more significant) 64 bits of the address.
+ *
+ * @param valueHigh the higher (more significant) 64 bits of the address.
+ */
+ public void setValueHigh(long valueHigh) {
+ this.valueHigh = valueHigh;
+ }
+
+ /**
* Get the value of the lower (less significant) 64 bits of the address.
*
* @return the value of the lower (less significant) 64 bits of the
@@ -50,6 +73,15 @@
public long valueLow() { return valueLow; }
/**
+ * Get the value of the lower (less significant) 64 bits of the address.
+ *
+ * @param valueLow the lower (less significant) 64 bits of the address.
+ */
+ public void setValueLow(long valueLow) {
+ this.valueLow = valueLow;
+ }
+
+ /**
* Set the value of the IPv6 address.
*
* @param valueHigh the higher (more significant) 64 bits of the address.