commonMain.media.PreferredCodec.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.PreferredCodec 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 PreferredCodec(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
)
public val audio: String? = null,
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
)
public val video: String? = 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 PreferredCodec) return false
if (unknownFields != other.unknownFields) return false
if (audio != other.audio) return false
if (video != other.video) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (audio?.hashCode() ?: 0)
result = result * 37 + (video?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (audio != null) result += """audio=${sanitize(audio)}"""
if (video != null) result += """video=${sanitize(video)}"""
return result.joinToString(prefix = "PreferredCodec{", separator = ", ", postfix = "}")
}
public fun copy(
audio: String? = this.audio,
video: String? = this.video,
unknownFields: ByteString = this.unknownFields,
): PreferredCodec = PreferredCodec(audio, video, unknownFields)
public companion object {
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
PreferredCodec::class,
"type.googleapis.com/media.PreferredCodec",
PROTO_3,
null,
"media/common.proto"
) {
public override fun encodedSize(`value`: PreferredCodec): Int {
var size = value.unknownFields.size
size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.audio)
size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.video)
return size
}
public override fun encode(writer: ProtoWriter, `value`: PreferredCodec): Unit {
ProtoAdapter.STRING.encodeWithTag(writer, 1, value.audio)
ProtoAdapter.STRING.encodeWithTag(writer, 2, value.video)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: PreferredCodec): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.STRING.encodeWithTag(writer, 2, value.video)
ProtoAdapter.STRING.encodeWithTag(writer, 1, value.audio)
}
public override fun decode(reader: ProtoReader): PreferredCodec {
var audio: String? = null
var video: String? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> audio = ProtoAdapter.STRING.decode(reader)
2 -> video = ProtoAdapter.STRING.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return PreferredCodec(
audio = audio,
video = video,
unknownFields = unknownFields
)
}
public override fun redact(`value`: PreferredCodec): PreferredCodec = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}