1 package sample 2 3 import kotlinx.serialization.SerialName 4 import kotlinx.serialization.Serializable 5 6 @Serializable 7 class EmptyClassB : EmptyBase() 8 9 @Serializable 10 open class Car : Vehicle() { 11 var maxSpeed: Int = 100 12 equalsnull13 override fun equals(other: Any?): Boolean { 14 if (this === other) return true 15 if (other !is Car) return false 16 if (name != other.name) return false 17 if (color != other.color) return false 18 if (maxSpeed != other.maxSpeed) return false 19 20 return true 21 } 22 hashCodenull23 override fun hashCode(): Int { 24 return maxSpeed.hashCode() 25 } 26 toStringnull27 override fun toString(): String { 28 return "Car(name=$name, color=$color, maxSpeed=$maxSpeed)" 29 } 30 } 31 32 @Serializable 33 data class TestSnippet( 34 @SerialName("experiments") val experiments: List<String> 35 ) : Snippet("test", "aaa") 36 37 @Serializable 38 data class ScreenSnippet( 39 @SerialName("name") val name: String, 40 @SerialName("uuid") val uuid: String? = null, 41 @SerialName("source") val source: String? = null 42 ) : Snippet("screen", "aaa") 43 44 @Serializable 45 class NotInConstructorTest : NotInConstructorBase() { 46 val c = "val c" 47 equalsnull48 override fun equals(other: Any?): Boolean { 49 if (this === other) return true 50 if (other !is NotInConstructorTest) return false 51 52 if (a != other.a) return false 53 if (b != other.b) return false 54 if (c != other.c) return false 55 56 return true 57 } 58 hashCodenull59 override fun hashCode(): Int { 60 return a.hashCode() * 31 + b.hashCode() * 31 + c.hashCode() 61 } 62 } 63