Skip to content

Commit ba0484f

Browse files
committed
Add equals/hashcode for STOMP Subscription
Issue: SPR-15229
1 parent f1133a8 commit ba0484f

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
@@ -499,6 +499,23 @@ public Expression getSelectorExpression() {
499499
return this.selectorExpression;
500500
}
501501

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

0 commit comments

Comments
 (0)