org.whispersystems.signalservice.internal.push.PniSignatureMessage.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signal-service-java Show documentation
Show all versions of signal-service-java Show documentation
Signal Service communication library for Java, unofficial fork
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: signalservice.PniSignatureMessage in SignalService.proto
package org.whispersystems.signalservice.`internal`.push
import com.squareup.wire.FieldEncoding
import com.squareup.wire.Message
import com.squareup.wire.ProtoAdapter
import com.squareup.wire.ProtoReader
import com.squareup.wire.ProtoWriter
import com.squareup.wire.ReverseProtoWriter
import com.squareup.wire.Syntax.PROTO_2
import com.squareup.wire.WireField
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Unit
import kotlin.jvm.JvmField
import okio.ByteString
public class PniSignatureMessage(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
)
@JvmField
public val pni: ByteString? = null,
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
)
@JvmField
public val signature: ByteString? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.pni = pni
builder.signature = signature
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is PniSignatureMessage) return false
if (unknownFields != other.unknownFields) return false
if (pni != other.pni) return false
if (signature != other.signature) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (pni?.hashCode() ?: 0)
result = result * 37 + (signature?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (pni != null) result += """pni=$pni"""
if (signature != null) result += """signature=$signature"""
return result.joinToString(prefix = "PniSignatureMessage{", separator = ", ", postfix = "}")
}
public fun copy(
pni: ByteString? = this.pni,
signature: ByteString? = this.signature,
unknownFields: ByteString = this.unknownFields,
): PniSignatureMessage = PniSignatureMessage(pni, signature, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var pni: ByteString? = null
@JvmField
public var signature: ByteString? = null
public fun pni(pni: ByteString?): Builder {
this.pni = pni
return this
}
public fun signature(signature: ByteString?): Builder {
this.signature = signature
return this
}
public override fun build(): PniSignatureMessage = PniSignatureMessage(
pni = pni,
signature = signature,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object :
ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
PniSignatureMessage::class,
"type.googleapis.com/signalservice.PniSignatureMessage",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: PniSignatureMessage): Int {
var size = value.unknownFields.size
size += ProtoAdapter.BYTES.encodedSizeWithTag(1, value.pni)
size += ProtoAdapter.BYTES.encodedSizeWithTag(2, value.signature)
return size
}
public override fun encode(writer: ProtoWriter, `value`: PniSignatureMessage): Unit {
ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.pni)
ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.signature)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: PniSignatureMessage): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.signature)
ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.pni)
}
public override fun decode(reader: ProtoReader): PniSignatureMessage {
var pni: ByteString? = null
var signature: ByteString? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> pni = ProtoAdapter.BYTES.decode(reader)
2 -> signature = ProtoAdapter.BYTES.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return PniSignatureMessage(
pni = pni,
signature = signature,
unknownFields = unknownFields
)
}
public override fun redact(`value`: PniSignatureMessage): PniSignatureMessage = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}