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

com.wavesplatform.protobuf.transaction.ExchangeTransactionData.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.protobuf.transaction

@SerialVersionUID(0L)
final case class ExchangeTransactionData(
    amount: _root_.scala.Long = 0L,
    price: _root_.scala.Long = 0L,
    buyMatcherFee: _root_.scala.Long = 0L,
    sellMatcherFee: _root_.scala.Long = 0L,
    orders: _root_.scala.Seq[com.wavesplatform.protobuf.order.Order] = _root_.scala.Seq.empty,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ExchangeTransactionData] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = amount
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(1, __value)
        }
      };
      
      {
        val __value = price
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(2, __value)
        }
      };
      
      {
        val __value = buyMatcherFee
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(3, __value)
        }
      };
      
      {
        val __value = sellMatcherFee
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(4, __value)
        }
      };
      orders.foreach { __item =>
        val __value = __item
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      __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 = amount
        if (__v != 0L) {
          _output__.writeInt64(1, __v)
        }
      };
      {
        val __v = price
        if (__v != 0L) {
          _output__.writeInt64(2, __v)
        }
      };
      {
        val __v = buyMatcherFee
        if (__v != 0L) {
          _output__.writeInt64(3, __v)
        }
      };
      {
        val __v = sellMatcherFee
        if (__v != 0L) {
          _output__.writeInt64(4, __v)
        }
      };
      orders.foreach { __v =>
        val __m = __v
        _output__.writeTag(5, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def withAmount(__v: _root_.scala.Long): ExchangeTransactionData = copy(amount = __v)
    def withPrice(__v: _root_.scala.Long): ExchangeTransactionData = copy(price = __v)
    def withBuyMatcherFee(__v: _root_.scala.Long): ExchangeTransactionData = copy(buyMatcherFee = __v)
    def withSellMatcherFee(__v: _root_.scala.Long): ExchangeTransactionData = copy(sellMatcherFee = __v)
    def clearOrders = copy(orders = _root_.scala.Seq.empty)
    def addOrders(__vs: com.wavesplatform.protobuf.order.Order *): ExchangeTransactionData = addAllOrders(__vs)
    def addAllOrders(__vs: Iterable[com.wavesplatform.protobuf.order.Order]): ExchangeTransactionData = copy(orders = orders ++ __vs)
    def withOrders(__v: _root_.scala.Seq[com.wavesplatform.protobuf.order.Order]): ExchangeTransactionData = copy(orders = __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 = amount
          if (__t != 0L) __t else null
        }
        case 2 => {
          val __t = price
          if (__t != 0L) __t else null
        }
        case 3 => {
          val __t = buyMatcherFee
          if (__t != 0L) __t else null
        }
        case 4 => {
          val __t = sellMatcherFee
          if (__t != 0L) __t else null
        }
        case 5 => orders
      }
    }
    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(amount)
        case 2 => _root_.scalapb.descriptors.PLong(price)
        case 3 => _root_.scalapb.descriptors.PLong(buyMatcherFee)
        case 4 => _root_.scalapb.descriptors.PLong(sellMatcherFee)
        case 5 => _root_.scalapb.descriptors.PRepeated(orders.iterator.map(_.toPMessage).toVector)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: com.wavesplatform.protobuf.transaction.ExchangeTransactionData.type = com.wavesplatform.protobuf.transaction.ExchangeTransactionData
    // @@protoc_insertion_point(GeneratedMessage[waves.ExchangeTransactionData])
}

object ExchangeTransactionData extends scalapb.GeneratedMessageCompanion[com.wavesplatform.protobuf.transaction.ExchangeTransactionData] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.wavesplatform.protobuf.transaction.ExchangeTransactionData] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.wavesplatform.protobuf.transaction.ExchangeTransactionData = {
    var __amount: _root_.scala.Long = 0L
    var __price: _root_.scala.Long = 0L
    var __buyMatcherFee: _root_.scala.Long = 0L
    var __sellMatcherFee: _root_.scala.Long = 0L
    val __orders: _root_.scala.collection.immutable.VectorBuilder[com.wavesplatform.protobuf.order.Order] = new _root_.scala.collection.immutable.VectorBuilder[com.wavesplatform.protobuf.order.Order]
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 8 =>
          __amount = _input__.readInt64()
        case 16 =>
          __price = _input__.readInt64()
        case 24 =>
          __buyMatcherFee = _input__.readInt64()
        case 32 =>
          __sellMatcherFee = _input__.readInt64()
        case 42 =>
          __orders += _root_.scalapb.LiteParser.readMessage[com.wavesplatform.protobuf.order.Order](_input__)
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    com.wavesplatform.protobuf.transaction.ExchangeTransactionData(
        amount = __amount,
        price = __price,
        buyMatcherFee = __buyMatcherFee,
        sellMatcherFee = __sellMatcherFee,
        orders = __orders.result(),
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[com.wavesplatform.protobuf.transaction.ExchangeTransactionData] = _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.protobuf.transaction.ExchangeTransactionData(
        amount = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        price = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        buyMatcherFee = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        sellMatcherFee = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        orders = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Seq[com.wavesplatform.protobuf.order.Order]]).getOrElse(_root_.scala.Seq.empty)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = TransactionProto.javaDescriptor.getMessageTypes().get(16)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = TransactionProto.scalaDescriptor.messages(16)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
    (__number: @_root_.scala.unchecked) match {
      case 5 => __out = com.wavesplatform.protobuf.order.Order
    }
    __out
  }
  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 = com.wavesplatform.protobuf.transaction.ExchangeTransactionData(
    amount = 0L,
    price = 0L,
    buyMatcherFee = 0L,
    sellMatcherFee = 0L,
    orders = _root_.scala.Seq.empty
  )
  implicit class ExchangeTransactionDataLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.wavesplatform.protobuf.transaction.ExchangeTransactionData]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.wavesplatform.protobuf.transaction.ExchangeTransactionData](_l) {
    def amount: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.amount)((c_, f_) => c_.copy(amount = f_))
    def price: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.price)((c_, f_) => c_.copy(price = f_))
    def buyMatcherFee: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.buyMatcherFee)((c_, f_) => c_.copy(buyMatcherFee = f_))
    def sellMatcherFee: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.sellMatcherFee)((c_, f_) => c_.copy(sellMatcherFee = f_))
    def orders: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[com.wavesplatform.protobuf.order.Order]] = field(_.orders)((c_, f_) => c_.copy(orders = f_))
  }
  final val AMOUNT_FIELD_NUMBER = 1
  final val PRICE_FIELD_NUMBER = 2
  final val BUY_MATCHER_FEE_FIELD_NUMBER = 3
  final val SELL_MATCHER_FEE_FIELD_NUMBER = 4
  final val ORDERS_FIELD_NUMBER = 5
  def of(
    amount: _root_.scala.Long,
    price: _root_.scala.Long,
    buyMatcherFee: _root_.scala.Long,
    sellMatcherFee: _root_.scala.Long,
    orders: _root_.scala.Seq[com.wavesplatform.protobuf.order.Order]
  ): _root_.com.wavesplatform.protobuf.transaction.ExchangeTransactionData = _root_.com.wavesplatform.protobuf.transaction.ExchangeTransactionData(
    amount,
    price,
    buyMatcherFee,
    sellMatcherFee,
    orders
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[waves.ExchangeTransactionData])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy