aboutsummaryrefslogtreecommitdiffstats
path: root/feature-server-pool
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-06-23 20:31:13 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-23 20:31:13 +0000
commit1af5858ec62be198f5c70e78c634d1d4baa5eb7b (patch)
tree731d09eab11c2cb13bcefa0ed5af9c7659e7b929 /feature-server-pool
parent6e4a58e5796c77fb571e8e60e3b6715a022439da (diff)
parent4bfcf9f47067d4c1e5e840270d9b93cd96f0bf80 (diff)
Merge "need Override equals and hashCode method"
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.