commonMain.media.ConsumerState.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-entities Show documentation
Show all versions of proto-entities Show documentation
KMP package which exports compiled protobuf entities to be used by other repos
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: media.ConsumerState 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 ConsumerState(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
label = WireField.Label.OMIT_IDENTITY,
jsonName = "consumerId",
)
public val consumer_id: String = "",
@field:WireField(
tag = 2,
adapter = "media.ProducerState#ADAPTER",
label = WireField.Label.OMIT_IDENTITY,
jsonName = "producerState",
)
public val producer_state: ProducerState? = null,
@field:WireField(
tag = 3,
adapter = "media.ProducerTrack#ADAPTER",
label = WireField.Label.OMIT_IDENTITY,
jsonName = "producerTrack",
)
public val producer_track: ProducerTrack? = null,
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 ConsumerState) return false
if (unknownFields != other.unknownFields) return false
if (consumer_id != other.consumer_id) return false
if (producer_state != other.producer_state) return false
if (producer_track != other.producer_track) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + consumer_id.hashCode()
result = result * 37 + (producer_state?.hashCode() ?: 0)
result = result * 37 + (producer_track?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
result += """consumer_id=${sanitize(consumer_id)}"""
if (producer_state != null) result += """producer_state=$producer_state"""
if (producer_track != null) result += """producer_track=$producer_track"""
return result.joinToString(prefix = "ConsumerState{", separator = ", ", postfix = "}")
}
public fun copy(
consumer_id: String = this.consumer_id,
producer_state: ProducerState? = this.producer_state,
producer_track: ProducerTrack? = this.producer_track,
unknownFields: ByteString = this.unknownFields,
): ConsumerState = ConsumerState(consumer_id, producer_state, producer_track, unknownFields)
public companion object {
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
ConsumerState::class,
"type.googleapis.com/media.ConsumerState",
PROTO_3,
null,
"media/common.proto"
) {
public override fun encodedSize(`value`: ConsumerState): Int {
var size = value.unknownFields.size
if (value.consumer_id != "") size += ProtoAdapter.STRING.encodedSizeWithTag(1,
value.consumer_id)
if (value.producer_state != null) size += ProducerState.ADAPTER.encodedSizeWithTag(2,
value.producer_state)
if (value.producer_track != null) size += ProducerTrack.ADAPTER.encodedSizeWithTag(3,
value.producer_track)
return size
}
public override fun encode(writer: ProtoWriter, `value`: ConsumerState): Unit {
if (value.consumer_id != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.consumer_id)
if (value.producer_state != null) ProducerState.ADAPTER.encodeWithTag(writer, 2,
value.producer_state)
if (value.producer_track != null) ProducerTrack.ADAPTER.encodeWithTag(writer, 3,
value.producer_track)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: ConsumerState): Unit {
writer.writeBytes(value.unknownFields)
if (value.producer_track != null) ProducerTrack.ADAPTER.encodeWithTag(writer, 3,
value.producer_track)
if (value.producer_state != null) ProducerState.ADAPTER.encodeWithTag(writer, 2,
value.producer_state)
if (value.consumer_id != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.consumer_id)
}
public override fun decode(reader: ProtoReader): ConsumerState {
var consumer_id: String = ""
var producer_state: ProducerState? = null
var producer_track: ProducerTrack? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> consumer_id = ProtoAdapter.STRING.decode(reader)
2 -> producer_state = ProducerState.ADAPTER.decode(reader)
3 -> producer_track = ProducerTrack.ADAPTER.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return ConsumerState(
consumer_id = consumer_id,
producer_state = producer_state,
producer_track = producer_track,
unknownFields = unknownFields
)
}
public override fun redact(`value`: ConsumerState): ConsumerState = value.copy(
producer_state = value.producer_state?.let(ProducerState.ADAPTER::redact),
producer_track = value.producer_track?.let(ProducerTrack.ADAPTER::redact),
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}