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

commonMain.media.NestedScore.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: media.NestedScore in media/common.proto
package media

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`.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 okio.ByteString

public class NestedScore(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#INT32",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "encodingIdx",
  )
  public val encoding_idx: Int = 0,
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
  )
  public val rid: String = "",
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#INT32",
    label = WireField.Label.OMIT_IDENTITY,
  )
  public val score: Int = 0,
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#INT64",
    label = WireField.Label.OMIT_IDENTITY,
  )
  public val ssrc: Long = 0L,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @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 NestedScore) return false
    if (unknownFields != other.unknownFields) return false
    if (encoding_idx != other.encoding_idx) return false
    if (rid != other.rid) return false
    if (score != other.score) return false
    if (ssrc != other.ssrc) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + encoding_idx.hashCode()
      result = result * 37 + rid.hashCode()
      result = result * 37 + score.hashCode()
      result = result * 37 + ssrc.hashCode()
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    result += """encoding_idx=$encoding_idx"""
    result += """rid=${sanitize(rid)}"""
    result += """score=$score"""
    result += """ssrc=$ssrc"""
    return result.joinToString(prefix = "NestedScore{", separator = ", ", postfix = "}")
  }

  public fun copy(
    encoding_idx: Int = this.encoding_idx,
    rid: String = this.rid,
    score: Int = this.score,
    ssrc: Long = this.ssrc,
    unknownFields: ByteString = this.unknownFields,
  ): NestedScore = NestedScore(encoding_idx, rid, score, ssrc, unknownFields)

  public companion object {
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      NestedScore::class, 
      "type.googleapis.com/media.NestedScore", 
      PROTO_3, 
      null, 
      "media/common.proto"
    ) {
      public override fun encodedSize(`value`: NestedScore): Int {
        var size = value.unknownFields.size
        if (value.encoding_idx != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(1,
            value.encoding_idx)
        if (value.rid != "") size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.rid)
        if (value.score != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(3, value.score)
        if (value.ssrc != 0L) size += ProtoAdapter.INT64.encodedSizeWithTag(4, value.ssrc)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: NestedScore): Unit {
        if (value.encoding_idx != 0) ProtoAdapter.INT32.encodeWithTag(writer, 1, value.encoding_idx)
        if (value.rid != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.rid)
        if (value.score != 0) ProtoAdapter.INT32.encodeWithTag(writer, 3, value.score)
        if (value.ssrc != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 4, value.ssrc)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: NestedScore): Unit {
        writer.writeBytes(value.unknownFields)
        if (value.ssrc != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 4, value.ssrc)
        if (value.score != 0) ProtoAdapter.INT32.encodeWithTag(writer, 3, value.score)
        if (value.rid != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.rid)
        if (value.encoding_idx != 0) ProtoAdapter.INT32.encodeWithTag(writer, 1, value.encoding_idx)
      }

      public override fun decode(reader: ProtoReader): NestedScore {
        var encoding_idx: Int = 0
        var rid: String = ""
        var score: Int = 0
        var ssrc: Long = 0L
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> encoding_idx = ProtoAdapter.INT32.decode(reader)
            2 -> rid = ProtoAdapter.STRING.decode(reader)
            3 -> score = ProtoAdapter.INT32.decode(reader)
            4 -> ssrc = ProtoAdapter.INT64.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return NestedScore(
          encoding_idx = encoding_idx,
          rid = rid,
          score = score,
          ssrc = ssrc,
          unknownFields = unknownFields
        )
      }

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

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy