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

io.wavebeans.execution.distributed.proto.DoubleArrayProtoValue.kt Maven / Gradle / Ivy

package io.wavebeans.execution.distributed.proto

import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber

fun DoubleArray?.toProtoValue(): DoubleArrayProtoValue = DoubleArrayProtoValue(this == null, this ?: DoubleArray(0))

@Serializable
data class DoubleArrayProtoValue(
        @ProtoNumber(1)
        override val isNull: Boolean,
        @ProtoNumber(2)
        override val value: DoubleArray
) : ProtoValue {

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as DoubleArrayProtoValue

        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
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy