diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2020-06-23 20:31:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-06-23 20:31:13 +0000 |
commit | 1af5858ec62be198f5c70e78c634d1d4baa5eb7b (patch) | |
tree | 731d09eab11c2cb13bcefa0ed5af9c7659e7b929 /feature-server-pool/src | |
parent | 6e4a58e5796c77fb571e8e60e3b6715a022439da (diff) | |
parent | 4bfcf9f47067d4c1e5e840270d9b93cd96f0bf80 (diff) |
Merge "need Override equals and hashCode method"
Diffstat (limited to 'feature-server-pool/src')
-rw-r--r-- | feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java | 17 |
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. |