org.whispersystems.signalservice.internal.push.ContactDetails.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.ContactDetails 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
import com.squareup.wire.Syntax.PROTO_2
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 okio.ByteString
public class ContactDetails(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
)
@JvmField
public val number: String? = null,
@field:WireField(
tag = 9,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
)
@JvmField
public val aci: String? = null,
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
)
@JvmField
public val name: String? = null,
@field:WireField(
tag = 3,
adapter = "org.whispersystems.signalservice.internal.push.ContactDetails${'$'}Avatar#ADAPTER",
)
@JvmField
public val avatar: Avatar? = null,
@field:WireField(
tag = 4,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
)
@JvmField
public val color: String? = null,
@field:WireField(
tag = 5,
adapter = "org.whispersystems.signalservice.internal.push.Verified#ADAPTER",
)
@JvmField
public val verified: Verified? = null,
@field:WireField(
tag = 6,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
)
@JvmField
public val profileKey: ByteString? = null,
@field:WireField(
tag = 8,
adapter = "com.squareup.wire.ProtoAdapter#UINT32",
)
@JvmField
public val expireTimer: Int? = null,
@field:WireField(
tag = 10,
adapter = "com.squareup.wire.ProtoAdapter#UINT32",
)
@JvmField
public val inboxPosition: Int? = null,
@field:WireField(
tag = 11,
adapter = "com.squareup.wire.ProtoAdapter#BOOL",
)
@JvmField
public val archived: Boolean? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.number = number
builder.aci = aci
builder.name = name
builder.avatar = avatar
builder.color = color
builder.verified = verified
builder.profileKey = profileKey
builder.expireTimer = expireTimer
builder.inboxPosition = inboxPosition
builder.archived = archived
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is ContactDetails) return false
if (unknownFields != other.unknownFields) return false
if (number != other.number) return false
if (aci != other.aci) return false
if (name != other.name) return false
if (avatar != other.avatar) return false
if (color != other.color) return false
if (verified != other.verified) return false
if (profileKey != other.profileKey) return false
if (expireTimer != other.expireTimer) return false
if (inboxPosition != other.inboxPosition) return false
if (archived != other.archived) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (number?.hashCode() ?: 0)
result = result * 37 + (aci?.hashCode() ?: 0)
result = result * 37 + (name?.hashCode() ?: 0)
result = result * 37 + (avatar?.hashCode() ?: 0)
result = result * 37 + (color?.hashCode() ?: 0)
result = result * 37 + (verified?.hashCode() ?: 0)
result = result * 37 + (profileKey?.hashCode() ?: 0)
result = result * 37 + (expireTimer?.hashCode() ?: 0)
result = result * 37 + (inboxPosition?.hashCode() ?: 0)
result = result * 37 + (archived?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (number != null) result += """number=${sanitize(number)}"""
if (aci != null) result += """aci=${sanitize(aci)}"""
if (name != null) result += """name=${sanitize(name)}"""
if (avatar != null) result += """avatar=$avatar"""
if (color != null) result += """color=${sanitize(color)}"""
if (verified != null) result += """verified=$verified"""
if (profileKey != null) result += """profileKey=$profileKey"""
if (expireTimer != null) result += """expireTimer=$expireTimer"""
if (inboxPosition != null) result += """inboxPosition=$inboxPosition"""
if (archived != null) result += """archived=$archived"""
return result.joinToString(prefix = "ContactDetails{", separator = ", ", postfix = "}")
}
public fun copy(
number: String? = this.number,
aci: String? = this.aci,
name: String? = this.name,
avatar: Avatar? = this.avatar,
color: String? = this.color,
verified: Verified? = this.verified,
profileKey: ByteString? = this.profileKey,
expireTimer: Int? = this.expireTimer,
inboxPosition: Int? = this.inboxPosition,
archived: Boolean? = this.archived,
unknownFields: ByteString = this.unknownFields,
): ContactDetails = ContactDetails(number, aci, name, avatar, color, verified, profileKey,
expireTimer, inboxPosition, archived, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var number: String? = null
@JvmField
public var aci: String? = null
@JvmField
public var name: String? = null
@JvmField
public var avatar: Avatar? = null
@JvmField
public var color: String? = null
@JvmField
public var verified: Verified? = null
@JvmField
public var profileKey: ByteString? = null
@JvmField
public var expireTimer: Int? = null
@JvmField
public var inboxPosition: Int? = null
@JvmField
public var archived: Boolean? = null
public fun number(number: String?): Builder {
this.number = number
return this
}
public fun aci(aci: String?): Builder {
this.aci = aci
return this
}
public fun name(name: String?): Builder {
this.name = name
return this
}
public fun avatar(avatar: Avatar?): Builder {
this.avatar = avatar
return this
}
public fun color(color: String?): Builder {
this.color = color
return this
}
public fun verified(verified: Verified?): Builder {
this.verified = verified
return this
}
public fun profileKey(profileKey: ByteString?): Builder {
this.profileKey = profileKey
return this
}
public fun expireTimer(expireTimer: Int?): Builder {
this.expireTimer = expireTimer
return this
}
public fun inboxPosition(inboxPosition: Int?): Builder {
this.inboxPosition = inboxPosition
return this
}
public fun archived(archived: Boolean?): Builder {
this.archived = archived
return this
}
public override fun build(): ContactDetails = ContactDetails(
number = number,
aci = aci,
name = name,
avatar = avatar,
color = color,
verified = verified,
profileKey = profileKey,
expireTimer = expireTimer,
inboxPosition = inboxPosition,
archived = archived,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
ContactDetails::class,
"type.googleapis.com/signalservice.ContactDetails",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: ContactDetails): Int {
var size = value.unknownFields.size
size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.number)
size += ProtoAdapter.STRING.encodedSizeWithTag(9, value.aci)
size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.name)
size += Avatar.ADAPTER.encodedSizeWithTag(3, value.avatar)
size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.color)
size += Verified.ADAPTER.encodedSizeWithTag(5, value.verified)
size += ProtoAdapter.BYTES.encodedSizeWithTag(6, value.profileKey)
size += ProtoAdapter.UINT32.encodedSizeWithTag(8, value.expireTimer)
size += ProtoAdapter.UINT32.encodedSizeWithTag(10, value.inboxPosition)
size += ProtoAdapter.BOOL.encodedSizeWithTag(11, value.archived)
return size
}
public override fun encode(writer: ProtoWriter, `value`: ContactDetails): Unit {
ProtoAdapter.STRING.encodeWithTag(writer, 1, value.number)
ProtoAdapter.STRING.encodeWithTag(writer, 9, value.aci)
ProtoAdapter.STRING.encodeWithTag(writer, 2, value.name)
Avatar.ADAPTER.encodeWithTag(writer, 3, value.avatar)
ProtoAdapter.STRING.encodeWithTag(writer, 4, value.color)
Verified.ADAPTER.encodeWithTag(writer, 5, value.verified)
ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.profileKey)
ProtoAdapter.UINT32.encodeWithTag(writer, 8, value.expireTimer)
ProtoAdapter.UINT32.encodeWithTag(writer, 10, value.inboxPosition)
ProtoAdapter.BOOL.encodeWithTag(writer, 11, value.archived)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: ContactDetails): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.BOOL.encodeWithTag(writer, 11, value.archived)
ProtoAdapter.UINT32.encodeWithTag(writer, 10, value.inboxPosition)
ProtoAdapter.UINT32.encodeWithTag(writer, 8, value.expireTimer)
ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.profileKey)
Verified.ADAPTER.encodeWithTag(writer, 5, value.verified)
ProtoAdapter.STRING.encodeWithTag(writer, 4, value.color)
Avatar.ADAPTER.encodeWithTag(writer, 3, value.avatar)
ProtoAdapter.STRING.encodeWithTag(writer, 2, value.name)
ProtoAdapter.STRING.encodeWithTag(writer, 9, value.aci)
ProtoAdapter.STRING.encodeWithTag(writer, 1, value.number)
}
public override fun decode(reader: ProtoReader): ContactDetails {
var number: String? = null
var aci: String? = null
var name: String? = null
var avatar: Avatar? = null
var color: String? = null
var verified: Verified? = null
var profileKey: ByteString? = null
var expireTimer: Int? = null
var inboxPosition: Int? = null
var archived: Boolean? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> number = ProtoAdapter.STRING.decode(reader)
9 -> aci = ProtoAdapter.STRING.decode(reader)
2 -> name = ProtoAdapter.STRING.decode(reader)
3 -> avatar = Avatar.ADAPTER.decode(reader)
4 -> color = ProtoAdapter.STRING.decode(reader)
5 -> verified = Verified.ADAPTER.decode(reader)
6 -> profileKey = ProtoAdapter.BYTES.decode(reader)
8 -> expireTimer = ProtoAdapter.UINT32.decode(reader)
10 -> inboxPosition = ProtoAdapter.UINT32.decode(reader)
11 -> archived = ProtoAdapter.BOOL.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return ContactDetails(
number = number,
aci = aci,
name = name,
avatar = avatar,
color = color,
verified = verified,
profileKey = profileKey,
expireTimer = expireTimer,
inboxPosition = inboxPosition,
archived = archived,
unknownFields = unknownFields
)
}
public override fun redact(`value`: ContactDetails): ContactDetails = value.copy(
avatar = value.avatar?.let(Avatar.ADAPTER::redact),
verified = value.verified?.let(Verified.ADAPTER::redact),
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
public class Avatar(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
)
@JvmField
public val contentType: String? = null,
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#UINT32",
)
@JvmField
public val length: Int? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.contentType = contentType
builder.length = length
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is Avatar) return false
if (unknownFields != other.unknownFields) return false
if (contentType != other.contentType) return false
if (length != other.length) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (contentType?.hashCode() ?: 0)
result = result * 37 + (length?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (contentType != null) result += """contentType=${sanitize(contentType)}"""
if (length != null) result += """length=$length"""
return result.joinToString(prefix = "Avatar{", separator = ", ", postfix = "}")
}
public fun copy(
contentType: String? = this.contentType,
length: Int? = this.length,
unknownFields: ByteString = this.unknownFields,
): Avatar = Avatar(contentType, length, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var contentType: String? = null
@JvmField
public var length: Int? = null
public fun contentType(contentType: String?): Builder {
this.contentType = contentType
return this
}
public fun length(length: Int?): Builder {
this.length = length
return this
}
public override fun build(): Avatar = Avatar(
contentType = contentType,
length = length,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
Avatar::class,
"type.googleapis.com/signalservice.ContactDetails.Avatar",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: Avatar): Int {
var size = value.unknownFields.size
size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.contentType)
size += ProtoAdapter.UINT32.encodedSizeWithTag(2, value.length)
return size
}
public override fun encode(writer: ProtoWriter, `value`: Avatar): Unit {
ProtoAdapter.STRING.encodeWithTag(writer, 1, value.contentType)
ProtoAdapter.UINT32.encodeWithTag(writer, 2, value.length)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: Avatar): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.UINT32.encodeWithTag(writer, 2, value.length)
ProtoAdapter.STRING.encodeWithTag(writer, 1, value.contentType)
}
public override fun decode(reader: ProtoReader): Avatar {
var contentType: String? = null
var length: Int? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> contentType = ProtoAdapter.STRING.decode(reader)
2 -> length = ProtoAdapter.UINT32.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return Avatar(
contentType = contentType,
length = length,
unknownFields = unknownFields
)
}
public override fun redact(`value`: Avatar): Avatar = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}
}