Edoardo Luppi
09/04/2025, 1:32 PMcopy
function without hashCode
and toString
? I don't want to use data classes in certain environments.hfhbd
09/04/2025, 2:34 PMhfhbd
09/04/2025, 2:34 PMEdoardo Luppi
09/04/2025, 2:36 PMcopy
.hfhbd
09/04/2025, 2:37 PMDrew Hamilton
09/04/2025, 2:51 PMabstract class CopyOnly {
final override fun equals(other: Any?): Boolean = super.equals(other)
final override fun hashCode(): Int = super.hashCode()
final override fun toString(): String = super.toString()
}
data class MyData(
val asdf: Int,
) : CopyOnly()
That would also leave you with the componentN
functions thoughAdam S
09/04/2025, 4:04 PMEdoardo Luppi
09/04/2025, 4:13 PMEdoardo Luppi
09/04/2025, 4:14 PM