io.mockk.impl.platform.CommonRef.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockk-common Show documentation
Show all versions of mockk-common Show documentation
Common(JS and Java) MockK module
The 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)) {
return value.hashCode()
} else {
return InternalPlatformDsl.identityHashCode(value)
}
}
override fun toString(): String = "Ref(${value::class.simpleName}@${InternalPlatform.hkd(value)})"
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy