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

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

// Code generated by Wire protocol buffer compiler, do not edit.
// Source: xyz.block.ftl.v1.schema.Error 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`.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 okio.ByteString

public class Error(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 0,
  )
  public val msg: String = "",
  @field:WireField(
    tag = 2,
    adapter = "xyz.block.ftl.v1.schema.Position#ADAPTER",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 1,
  )
  public val pos: Position? = null,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#INT64",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 2,
  )
  public val endColumn: Long = 0L,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @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 Error) return false
    if (unknownFields != other.unknownFields) return false
    if (msg != other.msg) return false
    if (pos != other.pos) return false
    if (endColumn != other.endColumn) return false
    return true
  }

  override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + msg.hashCode()
      result = result * 37 + (pos?.hashCode() ?: 0)
      result = result * 37 + endColumn.hashCode()
      super.hashCode = result
    }
    return result
  }

  override fun toString(): String {
    val result = mutableListOf()
    result += """msg=${sanitize(msg)}"""
    if (pos != null) result += """pos=$pos"""
    result += """endColumn=$endColumn"""
    return result.joinToString(prefix = "Error{", separator = ", ", postfix = "}")
  }

  public fun copy(
    msg: String = this.msg,
    pos: Position? = this.pos,
    endColumn: Long = this.endColumn,
    unknownFields: ByteString = this.unknownFields,
  ): Error = Error(msg, pos, endColumn, unknownFields)

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      Error::class, 
      "type.googleapis.com/xyz.block.ftl.v1.schema.Error", 
      PROTO_3, 
      null, 
      "xyz/block/ftl/v1/schema/schema.proto"
    ) {
      override fun encodedSize(`value`: Error): Int {
        var size = value.unknownFields.size
        if (value.msg != "") size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.msg)
        if (value.pos != null) size += Position.ADAPTER.encodedSizeWithTag(2, value.pos)
        if (value.endColumn != 0L) size += ProtoAdapter.INT64.encodedSizeWithTag(3, value.endColumn)
        return size
      }

      override fun encode(writer: ProtoWriter, `value`: Error) {
        if (value.msg != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.msg)
        if (value.pos != null) Position.ADAPTER.encodeWithTag(writer, 2, value.pos)
        if (value.endColumn != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 3, value.endColumn)
        writer.writeBytes(value.unknownFields)
      }

      override fun encode(writer: ReverseProtoWriter, `value`: Error) {
        writer.writeBytes(value.unknownFields)
        if (value.endColumn != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 3, value.endColumn)
        if (value.pos != null) Position.ADAPTER.encodeWithTag(writer, 2, value.pos)
        if (value.msg != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.msg)
      }

      override fun decode(reader: ProtoReader): Error {
        var msg: String = ""
        var pos: Position? = null
        var endColumn: Long = 0L
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> msg = ProtoAdapter.STRING.decode(reader)
            2 -> pos = Position.ADAPTER.decode(reader)
            3 -> endColumn = ProtoAdapter.INT64.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return Error(
          msg = msg,
          pos = pos,
          endColumn = endColumn,
          unknownFields = unknownFields
        )
      }

      override fun redact(`value`: Error): Error = value.copy(
        pos = value.pos?.let(Position.ADAPTER::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy