Add equals/hashcode for STOMP Subscription

Issue: SPR-15229
This commit is contained in:
Rossen Stoyanchev 2017-02-21 15:05:06 -05:00
parent 5ea5f81c00
commit f219680d42
1 changed files with 17 additions and 0 deletions

View File

@ -497,6 +497,23 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry {
return this.selectorExpression;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null || getClass() != other.getClass()) {
return false;
}
return getId().equals(((Subscription) other).getId());
}
@Override
public int hashCode() {
return getId().hashCode();
}
@Override
public String toString() {
return "subscription(id=" + this.id + ")";