org.whispersystems.signalservice.internal.push.Verified.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.Verified in SignalService.proto
package org.whispersystems.signalservice.`internal`.push
import com.squareup.wire.EnumAdapter
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
import com.squareup.wire.Syntax.PROTO_2
import com.squareup.wire.WireEnum
import com.squareup.wire.WireField
import com.squareup.wire.`internal`.sanitize
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Unit
import kotlin.jvm.JvmField
import kotlin.jvm.JvmStatic
import okio.ByteString
public class Verified(
@field:WireField(
tag = 5,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
)
@JvmField
public val destinationAci: String? = null,
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
)
@JvmField
public val identityKey: ByteString? = null,
@field:WireField(
tag = 3,
adapter = "org.whispersystems.signalservice.internal.push.Verified${'$'}State#ADAPTER",
)
@JvmField
public val state: State? = null,
@field:WireField(
tag = 4,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
)
@JvmField
public val nullMessage: ByteString? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.destinationAci = destinationAci
builder.identityKey = identityKey
builder.state = state
builder.nullMessage = nullMessage
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is Verified) return false
if (unknownFields != other.unknownFields) return false
if (destinationAci != other.destinationAci) return false
if (identityKey != other.identityKey) return false
if (state != other.state) return false
if (nullMessage != other.nullMessage) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (destinationAci?.hashCode() ?: 0)
result = result * 37 + (identityKey?.hashCode() ?: 0)
result = result * 37 + (state?.hashCode() ?: 0)
result = result * 37 + (nullMessage?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (destinationAci != null) result += """destinationAci=${sanitize(destinationAci)}"""
if (identityKey != null) result += """identityKey=$identityKey"""
if (state != null) result += """state=$state"""
if (nullMessage != null) result += """nullMessage=$nullMessage"""
return result.joinToString(prefix = "Verified{", separator = ", ", postfix = "}")
}
public fun copy(
destinationAci: String? = this.destinationAci,
identityKey: ByteString? = this.identityKey,
state: State? = this.state,
nullMessage: ByteString? = this.nullMessage,
unknownFields: ByteString = this.unknownFields,
): Verified = Verified(destinationAci, identityKey, state, nullMessage, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var destinationAci: String? = null
@JvmField
public var identityKey: ByteString? = null
@JvmField
public var state: State? = null
@JvmField
public var nullMessage: ByteString? = null
public fun destinationAci(destinationAci: String?): Builder {
this.destinationAci = destinationAci
return this
}
public fun identityKey(identityKey: ByteString?): Builder {
this.identityKey = identityKey
return this
}
public fun state(state: State?): Builder {
this.state = state
return this
}
public fun nullMessage(nullMessage: ByteString?): Builder {
this.nullMessage = nullMessage
return this
}
public override fun build(): Verified = Verified(
destinationAci = destinationAci,
identityKey = identityKey,
state = state,
nullMessage = nullMessage,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
Verified::class,
"type.googleapis.com/signalservice.Verified",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: Verified): Int {
var size = value.unknownFields.size
size += ProtoAdapter.STRING.encodedSizeWithTag(5, value.destinationAci)
size += ProtoAdapter.BYTES.encodedSizeWithTag(2, value.identityKey)
size += State.ADAPTER.encodedSizeWithTag(3, value.state)
size += ProtoAdapter.BYTES.encodedSizeWithTag(4, value.nullMessage)
return size
}
public override fun encode(writer: ProtoWriter, `value`: Verified): Unit {
ProtoAdapter.STRING.encodeWithTag(writer, 5, value.destinationAci)
ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.identityKey)
State.ADAPTER.encodeWithTag(writer, 3, value.state)
ProtoAdapter.BYTES.encodeWithTag(writer, 4, value.nullMessage)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: Verified): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.BYTES.encodeWithTag(writer, 4, value.nullMessage)
State.ADAPTER.encodeWithTag(writer, 3, value.state)
ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.identityKey)
ProtoAdapter.STRING.encodeWithTag(writer, 5, value.destinationAci)
}
public override fun decode(reader: ProtoReader): Verified {
var destinationAci: String? = null
var identityKey: ByteString? = null
var state: State? = null
var nullMessage: ByteString? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
5 -> destinationAci = ProtoAdapter.STRING.decode(reader)
2 -> identityKey = ProtoAdapter.BYTES.decode(reader)
3 -> try {
state = State.ADAPTER.decode(reader)
} catch (e: ProtoAdapter.EnumConstantNotFoundException) {
reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
}
4 -> nullMessage = ProtoAdapter.BYTES.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return Verified(
destinationAci = destinationAci,
identityKey = identityKey,
state = state,
nullMessage = nullMessage,
unknownFields = unknownFields
)
}
public override fun redact(`value`: Verified): Verified = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
public enum class State(
public override val `value`: Int,
) : WireEnum {
DEFAULT(0),
VERIFIED(1),
UNVERIFIED(2),
;
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : EnumAdapter(
State::class,
PROTO_2,
State.DEFAULT
) {
public override fun fromValue(`value`: Int): State? = State.fromValue(value)
}
@JvmStatic
public fun fromValue(`value`: Int): State? = when (value) {
0 -> DEFAULT
1 -> VERIFIED
2 -> UNVERIFIED
else -> null
}
}
}
}