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

xyz.block.ftl.v1.schema.Module.kt Maven / Gradle / Ivy

There is a newer version: 0.189.0
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: xyz.block.ftl.v1.schema.Module in xyz/block/ftl/v1/schema/schema.proto
@file:Suppress("DEPRECATION")

package xyz.block.ftl.v1.schema

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`.JvmField
import com.squareup.wire.`internal`.immutableCopyOf
import com.squareup.wire.`internal`.redactElements
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.Suppress
import kotlin.collections.List
import okio.ByteString

public class Module(
  @field:WireField(
    tag = 31_634,
    adapter = "xyz.block.ftl.v1.schema.ModuleRuntime#ADAPTER",
    schemaIndex = 0,
  )
  public val runtime: ModuleRuntime? = null,
  @field:WireField(
    tag = 1,
    adapter = "xyz.block.ftl.v1.schema.Position#ADAPTER",
    schemaIndex = 1,
  )
  public val pos: Position? = null,
  comments: List = emptyList(),
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#BOOL",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 3,
  )
  public val builtin: Boolean = false,
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 4,
  )
  public val name: String = "",
  decls: List = emptyList(),
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.REPEATED,
    schemaIndex = 2,
  )
  public val comments: List = immutableCopyOf("comments", comments)

  @field:WireField(
    tag = 5,
    adapter = "xyz.block.ftl.v1.schema.Decl#ADAPTER",
    label = WireField.Label.REPEATED,
    schemaIndex = 5,
  )
  public val decls: List = immutableCopyOf("decls", decls)

  @Deprecated(
    message = "Shouldn't be used in Kotlin",
    level = DeprecationLevel.HIDDEN,
  )
  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")

  override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is Module) return false
    if (unknownFields != other.unknownFields) return false
    if (runtime != other.runtime) return false
    if (pos != other.pos) return false
    if (comments != other.comments) return false
    if (builtin != other.builtin) return false
    if (name != other.name) return false
    if (decls != other.decls) return false
    return true
  }

  override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (runtime?.hashCode() ?: 0)
      result = result * 37 + (pos?.hashCode() ?: 0)
      result = result * 37 + comments.hashCode()
      result = result * 37 + builtin.hashCode()
      result = result * 37 + name.hashCode()
      result = result * 37 + decls.hashCode()
      super.hashCode = result
    }
    return result
  }

  override fun toString(): String {
    val result = mutableListOf()
    if (runtime != null) result += """runtime=$runtime"""
    if (pos != null) result += """pos=$pos"""
    if (comments.isNotEmpty()) result += """comments=${sanitize(comments)}"""
    result += """builtin=$builtin"""
    result += """name=${sanitize(name)}"""
    if (decls.isNotEmpty()) result += """decls=$decls"""
    return result.joinToString(prefix = "Module{", separator = ", ", postfix = "}")
  }

  public fun copy(
    runtime: ModuleRuntime? = this.runtime,
    pos: Position? = this.pos,
    comments: List = this.comments,
    builtin: Boolean = this.builtin,
    name: String = this.name,
    decls: List = this.decls,
    unknownFields: ByteString = this.unknownFields,
  ): Module = Module(runtime, pos, comments, builtin, name, decls, unknownFields)

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      Module::class, 
      "type.googleapis.com/xyz.block.ftl.v1.schema.Module", 
      PROTO_3, 
      null, 
      "xyz/block/ftl/v1/schema/schema.proto"
    ) {
      override fun encodedSize(`value`: Module): Int {
        var size = value.unknownFields.size
        size += ModuleRuntime.ADAPTER.encodedSizeWithTag(31_634, value.runtime)
        size += Position.ADAPTER.encodedSizeWithTag(1, value.pos)
        size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(2, value.comments)
        if (value.builtin != false) size += ProtoAdapter.BOOL.encodedSizeWithTag(3, value.builtin)
        if (value.name != "") size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.name)
        size += Decl.ADAPTER.asRepeated().encodedSizeWithTag(5, value.decls)
        return size
      }

      override fun encode(writer: ProtoWriter, `value`: Module) {
        ModuleRuntime.ADAPTER.encodeWithTag(writer, 31_634, value.runtime)
        Position.ADAPTER.encodeWithTag(writer, 1, value.pos)
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 2, value.comments)
        if (value.builtin != false) ProtoAdapter.BOOL.encodeWithTag(writer, 3, value.builtin)
        if (value.name != "") ProtoAdapter.STRING.encodeWithTag(writer, 4, value.name)
        Decl.ADAPTER.asRepeated().encodeWithTag(writer, 5, value.decls)
        writer.writeBytes(value.unknownFields)
      }

      override fun encode(writer: ReverseProtoWriter, `value`: Module) {
        writer.writeBytes(value.unknownFields)
        Decl.ADAPTER.asRepeated().encodeWithTag(writer, 5, value.decls)
        if (value.name != "") ProtoAdapter.STRING.encodeWithTag(writer, 4, value.name)
        if (value.builtin != false) ProtoAdapter.BOOL.encodeWithTag(writer, 3, value.builtin)
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 2, value.comments)
        Position.ADAPTER.encodeWithTag(writer, 1, value.pos)
        ModuleRuntime.ADAPTER.encodeWithTag(writer, 31_634, value.runtime)
      }

      override fun decode(reader: ProtoReader): Module {
        var runtime: ModuleRuntime? = null
        var pos: Position? = null
        val comments = mutableListOf()
        var builtin: Boolean = false
        var name: String = ""
        val decls = mutableListOf()
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            31_634 -> runtime = ModuleRuntime.ADAPTER.decode(reader)
            1 -> pos = Position.ADAPTER.decode(reader)
            2 -> comments.add(ProtoAdapter.STRING.decode(reader))
            3 -> builtin = ProtoAdapter.BOOL.decode(reader)
            4 -> name = ProtoAdapter.STRING.decode(reader)
            5 -> decls.add(Decl.ADAPTER.decode(reader))
            else -> reader.readUnknownField(tag)
          }
        }
        return Module(
          runtime = runtime,
          pos = pos,
          comments = comments,
          builtin = builtin,
          name = name,
          decls = decls,
          unknownFields = unknownFields
        )
      }

      override fun redact(`value`: Module): Module = value.copy(
        runtime = value.runtime?.let(ModuleRuntime.ADAPTER::redact),
        pos = value.pos?.let(Position.ADAPTER::redact),
        decls = value.decls.redactElements(Decl.ADAPTER),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy