Merge pull request #1446 from Nicholas2015/hotfix_subscriber_array_494
Collective data de-duplication
This commit is contained in:
commit
defe701737
@ -16,6 +16,7 @@
|
||||
package com.alibaba.nacos.naming.pojo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author nicholas
|
||||
@ -91,4 +92,38 @@ public class Subscriber implements Serializable {
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Subscriber that = (Subscriber) o;
|
||||
return Objects.equals(addrStr, that.addrStr) &&
|
||||
Objects.equals(agent, that.agent) &&
|
||||
Objects.equals(app, that.app) &&
|
||||
Objects.equals(ip, that.ip) &&
|
||||
Objects.equals(namespaceId, that.namespaceId) &&
|
||||
Objects.equals(serviceName, that.serviceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(addrStr, agent, app, ip, namespaceId, serviceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Subscriber{" +
|
||||
"addrStr='" + addrStr + '\'' +
|
||||
", agent='" + agent + '\'' +
|
||||
", app='" + app + '\'' +
|
||||
", ip='" + ip + '\'' +
|
||||
", namespaceId='" + namespaceId + '\'' +
|
||||
", serviceName='" + serviceName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user