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

org.whispersystems.signalservice.internal.push.PaymentAddress.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.PaymentAddress 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 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 PaymentAddress(
  @field:WireField(
    tag = 1,
    adapter =
        "org.whispersystems.signalservice.internal.push.PaymentAddress${'$'}MobileCoinAddress#ADAPTER",
    oneofName = "Address",
  )
  @JvmField
  public val mobileCoinAddress: MobileCoinAddress? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  init {
  }

  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.mobileCoinAddress = mobileCoinAddress
    builder.addUnknownFields(unknownFields)
    return builder
  }

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is PaymentAddress) return false
    if (unknownFields != other.unknownFields) return false
    if (mobileCoinAddress != other.mobileCoinAddress) return false
    return true
  }

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

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

  public fun copy(mobileCoinAddress: MobileCoinAddress? = this.mobileCoinAddress,
      unknownFields: ByteString = this.unknownFields): PaymentAddress =
      PaymentAddress(mobileCoinAddress, unknownFields)

  public class Builder : Message.Builder() {
    @JvmField
    public var mobileCoinAddress: MobileCoinAddress? = null

    public fun mobileCoinAddress(mobileCoinAddress: MobileCoinAddress?): Builder {
      this.mobileCoinAddress = mobileCoinAddress
      return this
    }

    public override fun build(): PaymentAddress = PaymentAddress(
      mobileCoinAddress = mobileCoinAddress,
      unknownFields = buildUnknownFields()
    )
  }

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      PaymentAddress::class, 
      "type.googleapis.com/signalservice.PaymentAddress", 
      PROTO_2, 
      null, 
      "SignalService.proto"
    ) {
      public override fun encodedSize(`value`: PaymentAddress): Int {
        var size = value.unknownFields.size
        size += MobileCoinAddress.ADAPTER.encodedSizeWithTag(1, value.mobileCoinAddress)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: PaymentAddress): Unit {
        MobileCoinAddress.ADAPTER.encodeWithTag(writer, 1, value.mobileCoinAddress)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: PaymentAddress): Unit {
        writer.writeBytes(value.unknownFields)
        MobileCoinAddress.ADAPTER.encodeWithTag(writer, 1, value.mobileCoinAddress)
      }

      public override fun decode(reader: ProtoReader): PaymentAddress {
        var mobileCoinAddress: MobileCoinAddress? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> mobileCoinAddress = MobileCoinAddress.ADAPTER.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return PaymentAddress(
          mobileCoinAddress = mobileCoinAddress,
          unknownFields = unknownFields
        )
      }

      public override fun redact(`value`: PaymentAddress): PaymentAddress = value.copy(
        mobileCoinAddress = value.mobileCoinAddress?.let(MobileCoinAddress.ADAPTER::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }

  public class MobileCoinAddress(
    @field:WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    )
    @JvmField
    public val address: ByteString? = null,
    @field:WireField(
      tag = 2,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    )
    @JvmField
    public val signature: ByteString? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.address = address
      builder.signature = signature
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is MobileCoinAddress) return false
      if (unknownFields != other.unknownFields) return false
      if (address != other.address) return false
      if (signature != other.signature) return false
      return true
    }

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

    public override fun toString(): String {
      val result = mutableListOf()
      if (address != null) result += """address=$address"""
      if (signature != null) result += """signature=$signature"""
      return result.joinToString(prefix = "MobileCoinAddress{", separator = ", ", postfix = "}")
    }

    public fun copy(
      address: ByteString? = this.address,
      signature: ByteString? = this.signature,
      unknownFields: ByteString = this.unknownFields,
    ): MobileCoinAddress = MobileCoinAddress(address, signature, unknownFields)

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

      @JvmField
      public var signature: ByteString? = null

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

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

      public override fun build(): MobileCoinAddress = MobileCoinAddress(
        address = address,
        signature = signature,
        unknownFields = buildUnknownFields()
      )
    }

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

        public override fun encode(writer: ProtoWriter, `value`: MobileCoinAddress): Unit {
          ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.address)
          ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.signature)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: MobileCoinAddress): Unit {
          writer.writeBytes(value.unknownFields)
          ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.signature)
          ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.address)
        }

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

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

      private const val serialVersionUID: Long = 0L
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy