Browse Source

Add equals/hashcode for STOMP Subscription

Issue: SPR-15229
pull/1335/merge
Rossen Stoyanchev 8 years ago
parent
commit
f219680d42
  1. 17
      spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java

17
spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java

@ -497,6 +497,23 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry { @@ -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 + ")";

Loading…
Cancel
Save