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

com.wavesplatform.database.protobuf.TransactionMeta.scala Maven / Gradle / Ivy

The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3

package com.wavesplatform.database.protobuf

@SerialVersionUID(0L)
final case class TransactionMeta(
    height: _root_.scala.Int = 0,
    num: _root_.scala.Int = 0,
    `type`: _root_.scala.Int = 0,
    status: com.wavesplatform.protobuf.snapshot.TransactionStatus = com.wavesplatform.protobuf.snapshot.TransactionStatus.SUCCEEDED,
    spentComplexity: _root_.scala.Long = 0L,
    size: _root_.scala.Int = 0,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[TransactionMeta] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = height
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(1, __value)
        }
      };
      
      {
        val __value = num
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(2, __value)
        }
      };
      
      {
        val __value = `type`
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(3, __value)
        }
      };
      
      {
        val __value = status.value
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(4, __value)
        }
      };
      
      {
        val __value = spentComplexity
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(5, __value)
        }
      };
      
      {
        val __value = size
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(6, __value)
        }
      };
      __size += unknownFields.serializedSize
      __size
    }
    override def serializedSize: _root_.scala.Int = {
      var __size = __serializedSizeMemoized
      if (__size == 0) {
        __size = __computeSerializedSize() + 1
        __serializedSizeMemoized = __size
      }
      __size - 1
      
    }
    def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
      {
        val __v = height
        if (__v != 0) {
          _output__.writeInt32(1, __v)
        }
      };
      {
        val __v = num
        if (__v != 0) {
          _output__.writeInt32(2, __v)
        }
      };
      {
        val __v = `type`
        if (__v != 0) {
          _output__.writeInt32(3, __v)
        }
      };
      {
        val __v = status.value
        if (__v != 0) {
          _output__.writeEnum(4, __v)
        }
      };
      {
        val __v = spentComplexity
        if (__v != 0L) {
          _output__.writeInt64(5, __v)
        }
      };
      {
        val __v = size
        if (__v != 0) {
          _output__.writeInt32(6, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withHeight(__v: _root_.scala.Int): TransactionMeta = copy(height = __v)
    def withNum(__v: _root_.scala.Int): TransactionMeta = copy(num = __v)
    def withType(__v: _root_.scala.Int): TransactionMeta = copy(`type` = __v)
    def withStatus(__v: com.wavesplatform.protobuf.snapshot.TransactionStatus): TransactionMeta = copy(status = __v)
    def withSpentComplexity(__v: _root_.scala.Long): TransactionMeta = copy(spentComplexity = __v)
    def withSize(__v: _root_.scala.Int): TransactionMeta = copy(size = __v)
    def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
    def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
    def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
      (__fieldNumber: @_root_.scala.unchecked) match {
        case 1 => {
          val __t = height
          if (__t != 0) __t else null
        }
        case 2 => {
          val __t = num
          if (__t != 0) __t else null
        }
        case 3 => {
          val __t = `type`
          if (__t != 0) __t else null
        }
        case 4 => {
          val __t = status.javaValueDescriptor
          if (__t.getNumber() != 0) __t else null
        }
        case 5 => {
          val __t = spentComplexity
          if (__t != 0L) __t else null
        }
        case 6 => {
          val __t = size
          if (__t != 0) __t else null
        }
      }
    }
    def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
      _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
      (__field.number: @_root_.scala.unchecked) match {
        case 1 => _root_.scalapb.descriptors.PInt(height)
        case 2 => _root_.scalapb.descriptors.PInt(num)
        case 3 => _root_.scalapb.descriptors.PInt(`type`)
        case 4 => _root_.scalapb.descriptors.PEnum(status.scalaValueDescriptor)
        case 5 => _root_.scalapb.descriptors.PLong(spentComplexity)
        case 6 => _root_.scalapb.descriptors.PInt(size)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: com.wavesplatform.database.protobuf.TransactionMeta.type = com.wavesplatform.database.protobuf.TransactionMeta
    // @@protoc_insertion_point(GeneratedMessage[waves.api.TransactionMeta])
}

object TransactionMeta extends scalapb.GeneratedMessageCompanion[com.wavesplatform.database.protobuf.TransactionMeta] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.wavesplatform.database.protobuf.TransactionMeta] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.wavesplatform.database.protobuf.TransactionMeta = {
    var __height: _root_.scala.Int = 0
    var __num: _root_.scala.Int = 0
    var __type: _root_.scala.Int = 0
    var __status: com.wavesplatform.protobuf.snapshot.TransactionStatus = com.wavesplatform.protobuf.snapshot.TransactionStatus.SUCCEEDED
    var __spentComplexity: _root_.scala.Long = 0L
    var __size: _root_.scala.Int = 0
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 8 =>
          __height = _input__.readInt32()
        case 16 =>
          __num = _input__.readInt32()
        case 24 =>
          __type = _input__.readInt32()
        case 32 =>
          __status = com.wavesplatform.protobuf.snapshot.TransactionStatus.fromValue(_input__.readEnum())
        case 40 =>
          __spentComplexity = _input__.readInt64()
        case 48 =>
          __size = _input__.readInt32()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    com.wavesplatform.database.protobuf.TransactionMeta(
        height = __height,
        num = __num,
        `type` = __type,
        status = __status,
        spentComplexity = __spentComplexity,
        size = __size,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[com.wavesplatform.database.protobuf.TransactionMeta] = _root_.scalapb.descriptors.Reads{
    case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
      _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
      com.wavesplatform.database.protobuf.TransactionMeta(
        height = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        num = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        `type` = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        status = com.wavesplatform.protobuf.snapshot.TransactionStatus.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(com.wavesplatform.protobuf.snapshot.TransactionStatus.SUCCEEDED.scalaValueDescriptor).number),
        spentComplexity = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        size = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Int]).getOrElse(0)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = DatabaseProto.javaDescriptor.getMessageTypes().get(2)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = DatabaseProto.scalaDescriptor.messages(2)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number)
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = {
    (__fieldNumber: @_root_.scala.unchecked) match {
      case 4 => com.wavesplatform.protobuf.snapshot.TransactionStatus
    }
  }
  lazy val defaultInstance = com.wavesplatform.database.protobuf.TransactionMeta(
    height = 0,
    num = 0,
    `type` = 0,
    status = com.wavesplatform.protobuf.snapshot.TransactionStatus.SUCCEEDED,
    spentComplexity = 0L,
    size = 0
  )
  implicit class TransactionMetaLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.wavesplatform.database.protobuf.TransactionMeta]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.wavesplatform.database.protobuf.TransactionMeta](_l) {
    def height: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.height)((c_, f_) => c_.copy(height = f_))
    def num: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.num)((c_, f_) => c_.copy(num = f_))
    def `type`: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.`type`)((c_, f_) => c_.copy(`type` = f_))
    def status: _root_.scalapb.lenses.Lens[UpperPB, com.wavesplatform.protobuf.snapshot.TransactionStatus] = field(_.status)((c_, f_) => c_.copy(status = f_))
    def spentComplexity: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.spentComplexity)((c_, f_) => c_.copy(spentComplexity = f_))
    def size: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.size)((c_, f_) => c_.copy(size = f_))
  }
  final val HEIGHT_FIELD_NUMBER = 1
  final val NUM_FIELD_NUMBER = 2
  final val TYPE_FIELD_NUMBER = 3
  final val STATUS_FIELD_NUMBER = 4
  final val SPENT_COMPLEXITY_FIELD_NUMBER = 5
  final val SIZE_FIELD_NUMBER = 6
  def of(
    height: _root_.scala.Int,
    num: _root_.scala.Int,
    `type`: _root_.scala.Int,
    status: com.wavesplatform.protobuf.snapshot.TransactionStatus,
    spentComplexity: _root_.scala.Long,
    size: _root_.scala.Int
  ): _root_.com.wavesplatform.database.protobuf.TransactionMeta = _root_.com.wavesplatform.database.protobuf.TransactionMeta(
    height,
    num,
    `type`,
    status,
    spentComplexity,
    size
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[waves.api.TransactionMeta])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy