Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-07 01:10:09 -07:00
parent 7378429e90
commit a075d9737b
8 changed files with 107 additions and 31 deletions

View file

@ -6,8 +6,31 @@ package com.tangem.core.analytics.models
open class AnalyticsEvent(
val category: String,
val event: String,
var params: Map<String, String> = mapOf(),
val params: Map<String, String> = mapOf(),
) {
val id: String = "[$category] $event"
fun withParams(newParams: Map<String, String>) = AnalyticsEvent(category, event, newParams)
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as AnalyticsEvent
if (category != other.category) return false
if (event != other.event) return false
if (params != other.params) return false
if (id != other.id) return false
return true
}
override fun hashCode(): Int {
var result = category.hashCode()
result = 31 * result + event.hashCode()
result = 31 * result + params.hashCode()
result = 31 * result + id.hashCode()
return result
}
}