commonMain.com.pubnub.api.models.consumer.pubsub.PNMessageResult.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-kotlin-api-jvm Show documentation
Show all versions of pubnub-kotlin-api-jvm Show documentation
PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second!
The newest version!
package com.pubnub.api.models.consumer.pubsub
import com.pubnub.api.JsonElement
import com.pubnub.api.PubNubError
/**
* Wrapper around an actual message.
*/
class PNMessageResult(
private val basePubSubResult: PubSubResult,
override val message: JsonElement,
val error: PubNubError? = null,
) : MessageResult, PubSubResult by basePubSubResult {
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
if (other == null) {
return false
}
if (this::class != other::class) {
return false
}
other as PNMessageResult
if (basePubSubResult != other.basePubSubResult) {
return false
}
if (message != other.message) {
return false
}
if (error != other.error) {
return false
}
return true
}
override fun hashCode(): Int {
var result = basePubSubResult.hashCode()
result = 31 * result + message.hashCode()
result = 31 * result + (error?.hashCode() ?: 0)
return result
}
}