All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.mockk.impl.platform.CommonRef.kt Maven / Gradle / Ivy

There is a newer version: 1.13.12
Show newest version
package io.mockk.impl.platform

import io.mockk.InternalPlatformDsl
import io.mockk.impl.InternalPlatform
import io.mockk.impl.Ref

class CommonRef(override val value: Any) : Ref {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is Ref) return false
        return value === other.value
    }

    override fun hashCode(): Int =
        if (InternalPlatform.isPassedByValue(value::class)) {
            value.hashCode()
        } else {
            InternalPlatformDsl.identityHashCode(value)
        }

    override fun toString(): String = "Ref(${value::class.simpleName}@${InternalPlatform.hkd(value)})"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy