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

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

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