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

org.whispersystems.signalservice.internal.websocket.Snapshot.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.Snapshot in ShadowingStats.proto
package org.whispersystems.signalservice.`internal`.websocket

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_3
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 Snapshot(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#INT32",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val requestsCompared: Int = 0,
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#INT32",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val failures: Int = 0,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#INT32",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val badStatuses: Int = 0,
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#INT32",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val reconnects: Int = 0,
  @field:WireField(
    tag = 5,
    adapter = "com.squareup.wire.ProtoAdapter#INT64",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val lastNotified: Long = 0L,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.requestsCompared = requestsCompared
    builder.failures = failures
    builder.badStatuses = badStatuses
    builder.reconnects = reconnects
    builder.lastNotified = lastNotified
    builder.addUnknownFields(unknownFields)
    return builder
  }

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is Snapshot) return false
    if (unknownFields != other.unknownFields) return false
    if (requestsCompared != other.requestsCompared) return false
    if (failures != other.failures) return false
    if (badStatuses != other.badStatuses) return false
    if (reconnects != other.reconnects) return false
    if (lastNotified != other.lastNotified) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + requestsCompared.hashCode()
      result = result * 37 + failures.hashCode()
      result = result * 37 + badStatuses.hashCode()
      result = result * 37 + reconnects.hashCode()
      result = result * 37 + lastNotified.hashCode()
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    result += """requestsCompared=$requestsCompared"""
    result += """failures=$failures"""
    result += """badStatuses=$badStatuses"""
    result += """reconnects=$reconnects"""
    result += """lastNotified=$lastNotified"""
    return result.joinToString(prefix = "Snapshot{", separator = ", ", postfix = "}")
  }

  public fun copy(
    requestsCompared: Int = this.requestsCompared,
    failures: Int = this.failures,
    badStatuses: Int = this.badStatuses,
    reconnects: Int = this.reconnects,
    lastNotified: Long = this.lastNotified,
    unknownFields: ByteString = this.unknownFields,
  ): Snapshot = Snapshot(requestsCompared, failures, badStatuses, reconnects, lastNotified,
      unknownFields)

  public class Builder : Message.Builder() {
    @JvmField
    public var requestsCompared: Int = 0

    @JvmField
    public var failures: Int = 0

    @JvmField
    public var badStatuses: Int = 0

    @JvmField
    public var reconnects: Int = 0

    @JvmField
    public var lastNotified: Long = 0L

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

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

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

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

    public fun lastNotified(lastNotified: Long): Builder {
      this.lastNotified = lastNotified
      return this
    }

    public override fun build(): Snapshot = Snapshot(
      requestsCompared = requestsCompared,
      failures = failures,
      badStatuses = badStatuses,
      reconnects = reconnects,
      lastNotified = lastNotified,
      unknownFields = buildUnknownFields()
    )
  }

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      Snapshot::class, 
      "type.googleapis.com/signalservice.Snapshot", 
      PROTO_3, 
      null, 
      "ShadowingStats.proto"
    ) {
      public override fun encodedSize(`value`: Snapshot): Int {
        var size = value.unknownFields.size
        if (value.requestsCompared != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(1,
            value.requestsCompared)
        if (value.failures != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(2, value.failures)
        if (value.badStatuses != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(3,
            value.badStatuses)
        if (value.reconnects != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(4,
            value.reconnects)
        if (value.lastNotified != 0L) size += ProtoAdapter.INT64.encodedSizeWithTag(5,
            value.lastNotified)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: Snapshot): Unit {
        if (value.requestsCompared != 0) ProtoAdapter.INT32.encodeWithTag(writer, 1,
            value.requestsCompared)
        if (value.failures != 0) ProtoAdapter.INT32.encodeWithTag(writer, 2, value.failures)
        if (value.badStatuses != 0) ProtoAdapter.INT32.encodeWithTag(writer, 3, value.badStatuses)
        if (value.reconnects != 0) ProtoAdapter.INT32.encodeWithTag(writer, 4, value.reconnects)
        if (value.lastNotified != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 5,
            value.lastNotified)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: Snapshot): Unit {
        writer.writeBytes(value.unknownFields)
        if (value.lastNotified != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 5,
            value.lastNotified)
        if (value.reconnects != 0) ProtoAdapter.INT32.encodeWithTag(writer, 4, value.reconnects)
        if (value.badStatuses != 0) ProtoAdapter.INT32.encodeWithTag(writer, 3, value.badStatuses)
        if (value.failures != 0) ProtoAdapter.INT32.encodeWithTag(writer, 2, value.failures)
        if (value.requestsCompared != 0) ProtoAdapter.INT32.encodeWithTag(writer, 1,
            value.requestsCompared)
      }

      public override fun decode(reader: ProtoReader): Snapshot {
        var requestsCompared: Int = 0
        var failures: Int = 0
        var badStatuses: Int = 0
        var reconnects: Int = 0
        var lastNotified: Long = 0L
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> requestsCompared = ProtoAdapter.INT32.decode(reader)
            2 -> failures = ProtoAdapter.INT32.decode(reader)
            3 -> badStatuses = ProtoAdapter.INT32.decode(reader)
            4 -> reconnects = ProtoAdapter.INT32.decode(reader)
            5 -> lastNotified = ProtoAdapter.INT64.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return Snapshot(
          requestsCompared = requestsCompared,
          failures = failures,
          badStatuses = badStatuses,
          reconnects = reconnects,
          lastNotified = lastNotified,
          unknownFields = unknownFields
        )
      }

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

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy