Add hashCode and equals
@@ -4,6 +4,8 @@ package com.yahoo.vespa.hosted.controller.api.integration.noderepository;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Objects;
+
/**
* @author mpolden
*/
@@ -30,4 +32,19 @@ public class NodeOwner {
public String getInstance() {
return instance;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ NodeOwner nodeOwner = (NodeOwner) o;
+ return Objects.equals(tenant, nodeOwner.tenant) &&
+ Objects.equals(application, nodeOwner.application) &&
+ Objects.equals(instance, nodeOwner.instance);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(tenant, application, instance);
+ }
}
