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

org.whispersystems.signalservice.internal.push.GroupContextV2.kt Maven / Gradle / Ivy

There is a newer version: 2.15.3_unofficial_107
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: signalservice.GroupContextV2 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 GroupContextV2(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val masterKey: ByteString? = null,
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#UINT32",
  )
  @JvmField
  public val revision: Int? = null,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val groupChange: ByteString? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.masterKey = masterKey
    builder.revision = revision
    builder.groupChange = groupChange
    builder.addUnknownFields(unknownFields)
    return builder
  }

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is GroupContextV2) return false
    if (unknownFields != other.unknownFields) return false
    if (masterKey != other.masterKey) return false
    if (revision != other.revision) return false
    if (groupChange != other.groupChange) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (masterKey?.hashCode() ?: 0)
      result = result * 37 + (revision?.hashCode() ?: 0)
      result = result * 37 + (groupChange?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    if (masterKey != null) result += """masterKey=$masterKey"""
    if (revision != null) result += """revision=$revision"""
    if (groupChange != null) result += """groupChange=$groupChange"""
    return result.joinToString(prefix = "GroupContextV2{", separator = ", ", postfix = "}")
  }

  public fun copy(
    masterKey: ByteString? = this.masterKey,
    revision: Int? = this.revision,
    groupChange: ByteString? = this.groupChange,
    unknownFields: ByteString = this.unknownFields,
  ): GroupContextV2 = GroupContextV2(masterKey, revision, groupChange, unknownFields)

  public class Builder : Message.Builder() {
    @JvmField
    public var masterKey: ByteString? = null

    @JvmField
    public var revision: Int? = null

    @JvmField
    public var groupChange: ByteString? = null

    public fun masterKey(masterKey: ByteString?): Builder {
      this.masterKey = masterKey
      return this
    }

    public fun revision(revision: Int?): Builder {
      this.revision = revision
      return this
    }

    public fun groupChange(groupChange: ByteString?): Builder {
      this.groupChange = groupChange
      return this
    }

    public override fun build(): GroupContextV2 = GroupContextV2(
      masterKey = masterKey,
      revision = revision,
      groupChange = groupChange,
      unknownFields = buildUnknownFields()
    )
  }

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      GroupContextV2::class, 
      "type.googleapis.com/signalservice.GroupContextV2", 
      PROTO_2, 
      null, 
      "SignalService.proto"
    ) {
      public override fun encodedSize(`value`: GroupContextV2): Int {
        var size = value.unknownFields.size
        size += ProtoAdapter.BYTES.encodedSizeWithTag(1, value.masterKey)
        size += ProtoAdapter.UINT32.encodedSizeWithTag(2, value.revision)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(3, value.groupChange)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: GroupContextV2): Unit {
        ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.masterKey)
        ProtoAdapter.UINT32.encodeWithTag(writer, 2, value.revision)
        ProtoAdapter.BYTES.encodeWithTag(writer, 3, value.groupChange)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: GroupContextV2): Unit {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.BYTES.encodeWithTag(writer, 3, value.groupChange)
        ProtoAdapter.UINT32.encodeWithTag(writer, 2, value.revision)
        ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.masterKey)
      }

      public override fun decode(reader: ProtoReader): GroupContextV2 {
        var masterKey: ByteString? = null
        var revision: Int? = null
        var groupChange: ByteString? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> masterKey = ProtoAdapter.BYTES.decode(reader)
            2 -> revision = ProtoAdapter.UINT32.decode(reader)
            3 -> groupChange = ProtoAdapter.BYTES.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return GroupContextV2(
          masterKey = masterKey,
          revision = revision,
          groupChange = groupChange,
          unknownFields = unknownFields
        )
      }

      public override fun redact(`value`: GroupContextV2): GroupContextV2 = value.copy(
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy