mirror of https://github.com/apache/activemq.git
added equals() hashCode() methods
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@549883 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
955ceceea8
commit
0112df5605
|
@ -89,5 +89,23 @@ public class SubscriptionInfo implements DataStructure {
|
|||
public String toString() {
|
||||
return IntrospectionSupport.toString(this);
|
||||
}
|
||||
|
||||
public int hasCode() {
|
||||
int h1 = clientId != null ? clientId.hashCode():-1;
|
||||
int h2 = subcriptionName != null ? subcriptionName.hashCode():-1;
|
||||
return h1 ^ h2;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj){
|
||||
boolean result=false;
|
||||
if(obj instanceof SubscriptionInfo){
|
||||
SubscriptionInfo other=(SubscriptionInfo)obj;
|
||||
result=(clientId==null&&other.clientId==null||clientId!=null&&other.clientId!=null
|
||||
&&clientId.equals(other.clientId))
|
||||
&&(subcriptionName==null&&other.subcriptionName==null||subcriptionName!=null
|
||||
&&other.subcriptionName!=null&&subcriptionName.equals(other.subcriptionName));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue