Skip to content

Commit f219680

Browse files
committed
Add equals/hashcode for STOMP Subscription
Issue: SPR-15229
1 parent 5ea5f81 commit f219680

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,23 @@ public Expression getSelectorExpression() {
497497
return this.selectorExpression;
498498
}
499499

500+
@Override
501+
public boolean equals(Object other) {
502+
if (this == other) {
503+
return true;
504+
}
505+
if (other == null || getClass() != other.getClass()) {
506+
return false;
507+
}
508+
return getId().equals(((Subscription) other).getId());
509+
510+
}
511+
512+
@Override
513+
public int hashCode() {
514+
return getId().hashCode();
515+
}
516+
500517
@Override
501518
public String toString() {
502519
return "subscription(id=" + this.id + ")";

0 commit comments

Comments
 (0)