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

org.whispersystems.signalservice.internal.devices.DeviceName.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.DeviceName in DeviceName.proto
package org.whispersystems.signalservice.`internal`.devices

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 DeviceName(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val ephemeralPublic: ByteString? = null,
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val syntheticIv: ByteString? = null,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val ciphertext: ByteString? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.ephemeralPublic = ephemeralPublic
    builder.syntheticIv = syntheticIv
    builder.ciphertext = ciphertext
    builder.addUnknownFields(unknownFields)
    return builder
  }

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is DeviceName) return false
    if (unknownFields != other.unknownFields) return false
    if (ephemeralPublic != other.ephemeralPublic) return false
    if (syntheticIv != other.syntheticIv) return false
    if (ciphertext != other.ciphertext) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (ephemeralPublic?.hashCode() ?: 0)
      result = result * 37 + (syntheticIv?.hashCode() ?: 0)
      result = result * 37 + (ciphertext?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    if (ephemeralPublic != null) result += """ephemeralPublic=$ephemeralPublic"""
    if (syntheticIv != null) result += """syntheticIv=$syntheticIv"""
    if (ciphertext != null) result += """ciphertext=$ciphertext"""
    return result.joinToString(prefix = "DeviceName{", separator = ", ", postfix = "}")
  }

  public fun copy(
    ephemeralPublic: ByteString? = this.ephemeralPublic,
    syntheticIv: ByteString? = this.syntheticIv,
    ciphertext: ByteString? = this.ciphertext,
    unknownFields: ByteString = this.unknownFields,
  ): DeviceName = DeviceName(ephemeralPublic, syntheticIv, ciphertext, unknownFields)

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

    @JvmField
    public var syntheticIv: ByteString? = null

    @JvmField
    public var ciphertext: ByteString? = null

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

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

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

    public override fun build(): DeviceName = DeviceName(
      ephemeralPublic = ephemeralPublic,
      syntheticIv = syntheticIv,
      ciphertext = ciphertext,
      unknownFields = buildUnknownFields()
    )
  }

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

      public override fun encode(writer: ProtoWriter, `value`: DeviceName): Unit {
        ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.ephemeralPublic)
        ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.syntheticIv)
        ProtoAdapter.BYTES.encodeWithTag(writer, 3, value.ciphertext)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: DeviceName): Unit {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.BYTES.encodeWithTag(writer, 3, value.ciphertext)
        ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.syntheticIv)
        ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.ephemeralPublic)
      }

      public override fun decode(reader: ProtoReader): DeviceName {
        var ephemeralPublic: ByteString? = null
        var syntheticIv: ByteString? = null
        var ciphertext: ByteString? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> ephemeralPublic = ProtoAdapter.BYTES.decode(reader)
            2 -> syntheticIv = ProtoAdapter.BYTES.decode(reader)
            3 -> ciphertext = ProtoAdapter.BYTES.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return DeviceName(
          ephemeralPublic = ephemeralPublic,
          syntheticIv = syntheticIv,
          ciphertext = ciphertext,
          unknownFields = unknownFields
        )
      }

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

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy