[ONOS-3116] PortPairid modification
Change-Id: Ic057169cd549098f57e7a5e1c68cc2142636269b
diff --git a/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/PortPairId.java b/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/PortPairId.java
index 05c31aa..e14e95a 100644
--- a/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/PortPairId.java
+++ b/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/PortPairId.java
@@ -16,11 +16,9 @@
package org.onosproject.vtnrsc;
import static com.google.common.base.MoreObjects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
import java.util.UUID;
-
-import com.google.common.base.Objects;
+import java.util.Objects;
/**
* Representation of a Port Pair ID.
@@ -34,8 +32,7 @@
*
* @param id UUID id of port pair
*/
- private PortPairId(UUID id) {
- checkNotNull(id, "Port chain id can not be null");
+ private PortPairId(final UUID id) {
this.portPairId = id;
}
@@ -45,7 +42,7 @@
* @param id UUID of port pair id
* @return object of port pair id
*/
- public static PortPairId portPairId(UUID id) {
+ public static PortPairId portPairId(final UUID id) {
return new PortPairId(id);
}
@@ -55,7 +52,7 @@
* @param id port pair id in string
* @return object of port pair id
*/
- public static PortPairId portPairId(String id) {
+ public static PortPairId portPairId(final String id) {
return new PortPairId(UUID.fromString(id));
}
@@ -73,10 +70,9 @@
if (this == obj) {
return true;
}
-
- if (obj.getClass() == this.getClass()) {
- PortPairId that = (PortPairId) obj;
- return Objects.equal(this.portPairId, that.portPairId);
+ if (obj instanceof PortPairId) {
+ final PortPairId other = (PortPairId) obj;
+ return Objects.equals(this.portPairId, other.portPairId);
}
return false;
}
@@ -88,8 +84,6 @@
@Override
public String toString() {
- return toStringHelper(this)
- .add("portPairId", portPairId.toString())
- .toString();
+ return toStringHelper(this).add("portPairId", portPairId.toString()).toString();
}
}