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