From 9e1b70936e1fabaa57c520ad4f8dd93baa62dec0 Mon Sep 17 00:00:00 2001 From: Mansi Pandya Date: Wed, 2 Oct 2024 13:02:47 -0400 Subject: [PATCH] Revert code --- .../kotlin/com/mparticle/internal/BatchId.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/android-core/src/main/kotlin/com/mparticle/internal/BatchId.kt b/android-core/src/main/kotlin/com/mparticle/internal/BatchId.kt index 673fc26dc..183dbe993 100644 --- a/android-core/src/main/kotlin/com/mparticle/internal/BatchId.kt +++ b/android-core/src/main/kotlin/com/mparticle/internal/BatchId.kt @@ -21,4 +21,24 @@ class BatchId { dataplanId = readyMessage.dataplanId dataplanVersion = readyMessage.dataplanVersion } + + override fun equals(obj: Any?): Boolean { + if (obj !is BatchId) { + return false + } + for (i in 0 until fields().size) { + if (!MPUtility.isEqual(fields()[i], obj.fields()[i])) { + return false + } + } + return true + } + + override fun hashCode(): Int { + return fields().contentHashCode() + } + + private fun fields(): Array { + return arrayOf(mpid, sessionId, dataplanId, dataplanVersion) + } } \ No newline at end of file