aboutsummaryrefslogtreecommitdiffstats
path: root/feature-server-pool
diff options
context:
space:
mode:
authorTaka Cho <takamune.cho@att.com>2020-06-22 16:17:07 -0400
committerTaka Cho <takamune.cho@att.com>2020-06-22 16:18:59 -0400
commit4bfcf9f47067d4c1e5e840270d9b93cd96f0bf80 (patch)
tree759d29db55eaf418c1724333ea31186706f1346f /feature-server-pool
parentc951a18cd53cbd1d2c26a78b29b941c64150839f (diff)
need Override equals and hashCode method
Use eclipse to generate those two Overrides in order to avoid sonar issue Issue-ID: POLICY-2616 Change-Id: If7e887b99fa44dac5ac5fa6f8c8cfe677238576d Signed-off-by: Taka Cho <takamune.cho@att.com>
Diffstat (limited to 'feature-server-pool')
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java
index 511b79a7..c60683ef 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java
@@ -215,6 +215,23 @@ public class Server implements Comparable<Server> {
return Util.uuidComparator.compare(uuid, other.uuid);
}
+ @Override
+ public int hashCode() {
+ return Objects.hash(uuid);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof Server)) {
+ return false;
+ }
+ Server other = (Server) obj;
+ return Objects.equals(uuid, other.uuid);
+ }
+
/**
* This method may be invoked from any thread, and is used as the main
* entry point when testing.