io.wavebeans.execution.distributed.proto.IntArrayProtoValue.kt Maven / Gradle / Ivy
package io.wavebeans.execution.distributed.proto
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
fun IntArray?.toProtoValue(): IntArrayProtoValue = IntArrayProtoValue(this == null, this ?: IntArray(0))
@Serializable
data class IntArrayProtoValue(
@ProtoNumber(1)
override val isNull: Boolean,
@ProtoNumber(2)
override val value: IntArray
) : ProtoValue {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as IntArrayProtoValue
if (isNull != other.isNull) return false
if (!value.contentEquals(other.value)) return false
return true
}
override fun hashCode(): Int {
var result = isNull.hashCode()
result = 31 * result + value.contentHashCode()
return result
}
}