Rename Port to PortNumber
Current util.Port actually only represent a port number.
Renaming it to PortNumber, so that it matches what it actually reprsent.
- Updated javadoc
- Removed unnecessary hashCode calculation
- Hide default constructor from public
Change-Id: Ib26c746eaa27464356c4ca0abff6af5e321afc35
diff --git a/src/main/java/net/onrc/onos/core/util/SwitchPort.java b/src/main/java/net/onrc/onos/core/util/SwitchPort.java
index edb9f77..b3ed985 100644
--- a/src/main/java/net/onrc/onos/core/util/SwitchPort.java
+++ b/src/main/java/net/onrc/onos/core/util/SwitchPort.java
@@ -8,7 +8,7 @@
*/
public final class SwitchPort {
private final Dpid dpid; // The DPID of the switch
- private final Port port; // The port of the switch
+ private final PortNumber port; // The port of the switch
/**
* Default constructor.
@@ -24,7 +24,7 @@
* @param dpid the DPID to use.
* @param port the port to use.
*/
- public SwitchPort(Dpid dpid, Port port) {
+ public SwitchPort(Dpid dpid, PortNumber port) {
this.dpid = dpid;
this.port = port;
}
@@ -37,7 +37,7 @@
*/
public SwitchPort(long dpid, short port) {
this.dpid = new Dpid(dpid);
- this.port = new Port(port);
+ this.port = new PortNumber(port);
}
/**
@@ -56,7 +56,7 @@
* @return the port value of the Switch-Port.
*/
@JsonProperty("port")
- public Port port() {
+ public PortNumber port() {
return port;
}