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

xyz.stratalab.indexer.services.TxoStats.scala Maven / Gradle / Ivy

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

package xyz.stratalab.indexer.services

@SerialVersionUID(0L)
final case class TxoStats(
    spent: _root_.scala.Long = 0L,
    unspent: _root_.scala.Long = 0L,
    pending: _root_.scala.Long = 0L,
    total: _root_.scala.Long = 0L,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[TxoStats] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = spent
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(1, __value)
        }
      };
      
      {
        val __value = unspent
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(2, __value)
        }
      };
      
      {
        val __value = pending
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(4, __value)
        }
      };
      
      {
        val __value = total
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(5, __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 = spent
        if (__v != 0L) {
          _output__.writeUInt64(1, __v)
        }
      };
      {
        val __v = unspent
        if (__v != 0L) {
          _output__.writeUInt64(2, __v)
        }
      };
      {
        val __v = pending
        if (__v != 0L) {
          _output__.writeUInt64(4, __v)
        }
      };
      {
        val __v = total
        if (__v != 0L) {
          _output__.writeUInt64(5, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withSpent(__v: _root_.scala.Long): TxoStats = copy(spent = __v)
    def withUnspent(__v: _root_.scala.Long): TxoStats = copy(unspent = __v)
    def withPending(__v: _root_.scala.Long): TxoStats = copy(pending = __v)
    def withTotal(__v: _root_.scala.Long): TxoStats = copy(total = __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 = spent
          if (__t != 0L) __t else null
        }
        case 2 => {
          val __t = unspent
          if (__t != 0L) __t else null
        }
        case 4 => {
          val __t = pending
          if (__t != 0L) __t else null
        }
        case 5 => {
          val __t = total
          if (__t != 0L) __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.PLong(spent)
        case 2 => _root_.scalapb.descriptors.PLong(unspent)
        case 4 => _root_.scalapb.descriptors.PLong(pending)
        case 5 => _root_.scalapb.descriptors.PLong(total)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: xyz.stratalab.indexer.services.TxoStats.type = xyz.stratalab.indexer.services.TxoStats
    _root_.scalapb.validate.Validator.assertValid(this)(xyz.stratalab.indexer.services.TxoStatsValidator)
    // @@protoc_insertion_point(GeneratedMessage[xyz.stratalab.indexer.services.TxoStats])
}

object TxoStats extends scalapb.GeneratedMessageCompanion[xyz.stratalab.indexer.services.TxoStats] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[xyz.stratalab.indexer.services.TxoStats] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): xyz.stratalab.indexer.services.TxoStats = {
    var __spent: _root_.scala.Long = 0L
    var __unspent: _root_.scala.Long = 0L
    var __pending: _root_.scala.Long = 0L
    var __total: _root_.scala.Long = 0L
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 8 =>
          __spent = _input__.readUInt64()
        case 16 =>
          __unspent = _input__.readUInt64()
        case 32 =>
          __pending = _input__.readUInt64()
        case 40 =>
          __total = _input__.readUInt64()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    xyz.stratalab.indexer.services.TxoStats(
        spent = __spent,
        unspent = __unspent,
        pending = __pending,
        total = __total,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[xyz.stratalab.indexer.services.TxoStats] = _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.")
      xyz.stratalab.indexer.services.TxoStats(
        spent = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        unspent = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        pending = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        total = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Long]).getOrElse(0L)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = IndexerRpcProto.javaDescriptor.getMessageTypes().get(30)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = IndexerRpcProto.scalaDescriptor.messages(30)
  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[_] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = xyz.stratalab.indexer.services.TxoStats(
    spent = 0L,
    unspent = 0L,
    pending = 0L,
    total = 0L
  )
  implicit class TxoStatsLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, xyz.stratalab.indexer.services.TxoStats]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, xyz.stratalab.indexer.services.TxoStats](_l) {
    def spent: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.spent)((c_, f_) => c_.copy(spent = f_))
    def unspent: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.unspent)((c_, f_) => c_.copy(unspent = f_))
    def pending: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.pending)((c_, f_) => c_.copy(pending = f_))
    def total: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.total)((c_, f_) => c_.copy(total = f_))
  }
  final val SPENT_FIELD_NUMBER = 1
  final val UNSPENT_FIELD_NUMBER = 2
  final val PENDING_FIELD_NUMBER = 4
  final val TOTAL_FIELD_NUMBER = 5
  def of(
    spent: _root_.scala.Long,
    unspent: _root_.scala.Long,
    pending: _root_.scala.Long,
    total: _root_.scala.Long
  ): _root_.xyz.stratalab.indexer.services.TxoStats = _root_.xyz.stratalab.indexer.services.TxoStats(
    spent,
    unspent,
    pending,
    total
  )
  implicit def validator: scalapb.validate.Validator[xyz.stratalab.indexer.services.TxoStats] = xyz.stratalab.indexer.services.TxoStatsValidator
  // @@protoc_insertion_point(GeneratedMessageCompanion[xyz.stratalab.indexer.services.TxoStats])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy