Skip to content

Commit 9992745

Browse files
committed
refactor: impl equals/hashCode
1 parent e15030b commit 9992745

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/kotlin/spp/protocol/view/LiveViewSubscription.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,16 @@ data class LiveViewSubscription(
5353
json.put("liveViewConfig", liveViewConfig.toJson())
5454
return json
5555
}
56+
57+
override fun equals(other: Any?): Boolean {
58+
if (this === other) return true
59+
if (javaClass != other?.javaClass) return false
60+
other as LiveViewSubscription
61+
if (subscriptionId != other.subscriptionId) return false
62+
return true
63+
}
64+
65+
override fun hashCode(): Int {
66+
return subscriptionId?.hashCode() ?: 0
67+
}
5668
}

0 commit comments

Comments
 (0)