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/SwitchPort.java b/src/main/java/net/floodlightcontroller/util/SwitchPort.java
index 462cdfb..027b681 100644
--- a/src/main/java/net/floodlightcontroller/util/SwitchPort.java
+++ b/src/main/java/net/floodlightcontroller/util/SwitchPort.java
@@ -2,15 +2,12 @@
import net.floodlightcontroller.util.Dpid;
import net.floodlightcontroller.util.Port;
-import net.floodlightcontroller.util.serializers.SwitchPortSerializer;
import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
* The class representing a Switch-Port.
*/
-@JsonSerialize(using=SwitchPortSerializer.class)
public class SwitchPort {
private Dpid dpid; // The DPID of the switch
private Port port; // The port of the switch
@@ -37,16 +34,38 @@
*
* @return the DPID value of the Switch-Port.
*/
+ @JsonProperty("dpid")
public Dpid dpid() { return dpid; }
/**
+ * Set the DPID value of the Switch-Port.
+ *
+ * @param dpid the DPID to use.
+ */
+ @JsonProperty("dpid")
+ public void setDpid(Dpid dpid) {
+ this.dpid = dpid;
+ }
+
+ /**
* Get the port value of the Switch-Port.
*
* @return the port value of the Switch-Port.
*/
+ @JsonProperty("port")
public Port port() { return port; }
/**
+ * Set the port value of the Switch-Port.
+ *
+ * @param port the port to use.
+ */
+ @JsonProperty("port")
+ public void setPort(Port port) {
+ this.port = port;
+ }
+
+ /**
* Set the DPID and port values of the Switch-Port.
*
* @param dpid the DPID to use.