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

commonMain.socket.room.BroadcastMessage.kt Maven / Gradle / Ivy

Go to download

KMP package which exports compiled protobuf entities to be used by other repos

There is a newer version: 2.89.0
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: socket.room.BroadcastMessage in socket/room.proto
package socket.room

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 com.squareup.wire.`internal`.immutableCopyOf
import com.squareup.wire.`internal`.sanitize
import kotlin.Any
import kotlin.AssertionError
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.DeprecationLevel
import kotlin.Int
import kotlin.Long
import kotlin.Nothing
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import okio.ByteString

public class BroadcastMessage(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
  )
  public val type: String = "",
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    label = WireField.Label.OMIT_IDENTITY,
  )
  public val payload: ByteString = ByteString.EMPTY,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#UINT64",
    label = WireField.Label.OMIT_IDENTITY,
  )
  public val timestamp: Long = 0L,
  peer_ids: List = emptyList(),
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.REPEATED,
    jsonName = "peerIds",
  )
  public val peer_ids: List = immutableCopyOf("peer_ids", peer_ids)

  @Deprecated(
    message = "Shouldn't be used in Kotlin",
    level = DeprecationLevel.HIDDEN,
  )
  public override fun newBuilder(): Nothing = throw
      AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin")

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is BroadcastMessage) return false
    if (unknownFields != other.unknownFields) return false
    if (type != other.type) return false
    if (payload != other.payload) return false
    if (timestamp != other.timestamp) return false
    if (peer_ids != other.peer_ids) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + type.hashCode()
      result = result * 37 + payload.hashCode()
      result = result * 37 + timestamp.hashCode()
      result = result * 37 + peer_ids.hashCode()
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    result += """type=${sanitize(type)}"""
    result += """payload=$payload"""
    result += """timestamp=$timestamp"""
    if (peer_ids.isNotEmpty()) result += """peer_ids=${sanitize(peer_ids)}"""
    return result.joinToString(prefix = "BroadcastMessage{", separator = ", ", postfix = "}")
  }

  public fun copy(
    type: String = this.type,
    payload: ByteString = this.payload,
    timestamp: Long = this.timestamp,
    peer_ids: List = this.peer_ids,
    unknownFields: ByteString = this.unknownFields,
  ): BroadcastMessage = BroadcastMessage(type, payload, timestamp, peer_ids, unknownFields)

  public companion object {
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      BroadcastMessage::class, 
      "type.googleapis.com/socket.room.BroadcastMessage", 
      PROTO_3, 
      null, 
      "socket/room.proto"
    ) {
      public override fun encodedSize(`value`: BroadcastMessage): Int {
        var size = value.unknownFields.size
        if (value.type != "") size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.type)
        if (value.payload != ByteString.EMPTY) size += ProtoAdapter.BYTES.encodedSizeWithTag(2,
            value.payload)
        if (value.timestamp != 0L) size += ProtoAdapter.UINT64.encodedSizeWithTag(3,
            value.timestamp)
        size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(4, value.peer_ids)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: BroadcastMessage): Unit {
        if (value.type != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.type)
        if (value.payload != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 2,
            value.payload)
        if (value.timestamp != 0L) ProtoAdapter.UINT64.encodeWithTag(writer, 3, value.timestamp)
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 4, value.peer_ids)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: BroadcastMessage): Unit {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 4, value.peer_ids)
        if (value.timestamp != 0L) ProtoAdapter.UINT64.encodeWithTag(writer, 3, value.timestamp)
        if (value.payload != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 2,
            value.payload)
        if (value.type != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.type)
      }

      public override fun decode(reader: ProtoReader): BroadcastMessage {
        var type: String = ""
        var payload: ByteString = ByteString.EMPTY
        var timestamp: Long = 0L
        val peer_ids = mutableListOf()
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> type = ProtoAdapter.STRING.decode(reader)
            2 -> payload = ProtoAdapter.BYTES.decode(reader)
            3 -> timestamp = ProtoAdapter.UINT64.decode(reader)
            4 -> peer_ids.add(ProtoAdapter.STRING.decode(reader))
            else -> reader.readUnknownField(tag)
          }
        }
        return BroadcastMessage(
          type = type,
          payload = payload,
          timestamp = timestamp,
          peer_ids = peer_ids,
          unknownFields = unknownFields
        )
      }

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

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy