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

com.wavesplatform.database.protobuf.DataEntry.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 DataEntry(
    value: com.wavesplatform.database.protobuf.DataEntry.Value = com.wavesplatform.database.protobuf.DataEntry.Value.Empty,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[DataEntry] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      if (value.intValue.isDefined) {
        val __value = value.intValue.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(1, __value)
      };
      if (value.boolValue.isDefined) {
        val __value = value.boolValue.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(2, __value)
      };
      if (value.binaryValue.isDefined) {
        val __value = value.binaryValue.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(3, __value)
      };
      if (value.stringValue.isDefined) {
        val __value = value.stringValue.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(4, __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 = {
      value.intValue.foreach { __v =>
        val __m = __v
        _output__.writeInt64(1, __m)
      };
      value.boolValue.foreach { __v =>
        val __m = __v
        _output__.writeBool(2, __m)
      };
      value.binaryValue.foreach { __v =>
        val __m = __v
        _output__.writeBytes(3, __m)
      };
      value.stringValue.foreach { __v =>
        val __m = __v
        _output__.writeString(4, __m)
      };
      unknownFields.writeTo(_output__)
    }
    def getIntValue: _root_.scala.Long = value.intValue.getOrElse(0L)
    def withIntValue(__v: _root_.scala.Long): DataEntry = copy(value = com.wavesplatform.database.protobuf.DataEntry.Value.IntValue(__v))
    def getBoolValue: _root_.scala.Boolean = value.boolValue.getOrElse(false)
    def withBoolValue(__v: _root_.scala.Boolean): DataEntry = copy(value = com.wavesplatform.database.protobuf.DataEntry.Value.BoolValue(__v))
    def getBinaryValue: _root_.com.google.protobuf.ByteString = value.binaryValue.getOrElse(_root_.com.google.protobuf.ByteString.EMPTY)
    def withBinaryValue(__v: _root_.com.google.protobuf.ByteString): DataEntry = copy(value = com.wavesplatform.database.protobuf.DataEntry.Value.BinaryValue(__v))
    def getStringValue: _root_.scala.Predef.String = value.stringValue.getOrElse("")
    def withStringValue(__v: _root_.scala.Predef.String): DataEntry = copy(value = com.wavesplatform.database.protobuf.DataEntry.Value.StringValue(__v))
    def clearValue: DataEntry = copy(value = com.wavesplatform.database.protobuf.DataEntry.Value.Empty)
    def withValue(__v: com.wavesplatform.database.protobuf.DataEntry.Value): DataEntry = copy(value = __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 => value.intValue.orNull
        case 2 => value.boolValue.orNull
        case 3 => value.binaryValue.orNull
        case 4 => value.stringValue.orNull
      }
    }
    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 => value.intValue.map(_root_.scalapb.descriptors.PLong(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 2 => value.boolValue.map(_root_.scalapb.descriptors.PBoolean(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 3 => value.binaryValue.map(_root_.scalapb.descriptors.PByteString(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 4 => value.stringValue.map(_root_.scalapb.descriptors.PString(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: com.wavesplatform.database.protobuf.DataEntry.type = com.wavesplatform.database.protobuf.DataEntry
    // @@protoc_insertion_point(GeneratedMessage[waves.api.DataEntry])
}

object DataEntry extends scalapb.GeneratedMessageCompanion[com.wavesplatform.database.protobuf.DataEntry] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.wavesplatform.database.protobuf.DataEntry] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.wavesplatform.database.protobuf.DataEntry = {
    var __value: com.wavesplatform.database.protobuf.DataEntry.Value = com.wavesplatform.database.protobuf.DataEntry.Value.Empty
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 8 =>
          __value = com.wavesplatform.database.protobuf.DataEntry.Value.IntValue(_input__.readInt64())
        case 16 =>
          __value = com.wavesplatform.database.protobuf.DataEntry.Value.BoolValue(_input__.readBool())
        case 26 =>
          __value = com.wavesplatform.database.protobuf.DataEntry.Value.BinaryValue(_input__.readBytes())
        case 34 =>
          __value = com.wavesplatform.database.protobuf.DataEntry.Value.StringValue(_input__.readStringRequireUtf8())
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    com.wavesplatform.database.protobuf.DataEntry(
        value = __value,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[com.wavesplatform.database.protobuf.DataEntry] = _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.DataEntry(
        value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Long]]).map(com.wavesplatform.database.protobuf.DataEntry.Value.IntValue(_))
            .orElse[com.wavesplatform.database.protobuf.DataEntry.Value](__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]]).map(com.wavesplatform.database.protobuf.DataEntry.Value.BoolValue(_)))
            .orElse[com.wavesplatform.database.protobuf.DataEntry.Value](__fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[_root_.com.google.protobuf.ByteString]]).map(com.wavesplatform.database.protobuf.DataEntry.Value.BinaryValue(_)))
            .orElse[com.wavesplatform.database.protobuf.DataEntry.Value](__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Predef.String]]).map(com.wavesplatform.database.protobuf.DataEntry.Value.StringValue(_)))
            .getOrElse(com.wavesplatform.database.protobuf.DataEntry.Value.Empty)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = DatabaseProto.javaDescriptor.getMessageTypes().get(7)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = DatabaseProto.scalaDescriptor.messages(7)
  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 = com.wavesplatform.database.protobuf.DataEntry(
    value = com.wavesplatform.database.protobuf.DataEntry.Value.Empty
  )
  sealed trait Value extends _root_.scalapb.GeneratedOneof {
    def isEmpty: _root_.scala.Boolean = false
    def isDefined: _root_.scala.Boolean = true
    def isIntValue: _root_.scala.Boolean = false
    def isBoolValue: _root_.scala.Boolean = false
    def isBinaryValue: _root_.scala.Boolean = false
    def isStringValue: _root_.scala.Boolean = false
    def intValue: _root_.scala.Option[_root_.scala.Long] = _root_.scala.None
    def boolValue: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None
    def binaryValue: _root_.scala.Option[_root_.com.google.protobuf.ByteString] = _root_.scala.None
    def stringValue: _root_.scala.Option[_root_.scala.Predef.String] = _root_.scala.None
  }
  object Value {
    @SerialVersionUID(0L)
    case object Empty extends com.wavesplatform.database.protobuf.DataEntry.Value {
      type ValueType = _root_.scala.Nothing
      override def isEmpty: _root_.scala.Boolean = true
      override def isDefined: _root_.scala.Boolean = false
      override def number: _root_.scala.Int = 0
      override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
    }
  
    @SerialVersionUID(0L)
    final case class IntValue(value: _root_.scala.Long) extends com.wavesplatform.database.protobuf.DataEntry.Value {
      type ValueType = _root_.scala.Long
      override def isIntValue: _root_.scala.Boolean = true
      override def intValue: _root_.scala.Option[_root_.scala.Long] = Some(value)
      override def number: _root_.scala.Int = 1
    }
    @SerialVersionUID(0L)
    final case class BoolValue(value: _root_.scala.Boolean) extends com.wavesplatform.database.protobuf.DataEntry.Value {
      type ValueType = _root_.scala.Boolean
      override def isBoolValue: _root_.scala.Boolean = true
      override def boolValue: _root_.scala.Option[_root_.scala.Boolean] = Some(value)
      override def number: _root_.scala.Int = 2
    }
    @SerialVersionUID(0L)
    final case class BinaryValue(value: _root_.com.google.protobuf.ByteString) extends com.wavesplatform.database.protobuf.DataEntry.Value {
      type ValueType = _root_.com.google.protobuf.ByteString
      override def isBinaryValue: _root_.scala.Boolean = true
      override def binaryValue: _root_.scala.Option[_root_.com.google.protobuf.ByteString] = Some(value)
      override def number: _root_.scala.Int = 3
    }
    @SerialVersionUID(0L)
    final case class StringValue(value: _root_.scala.Predef.String) extends com.wavesplatform.database.protobuf.DataEntry.Value {
      type ValueType = _root_.scala.Predef.String
      override def isStringValue: _root_.scala.Boolean = true
      override def stringValue: _root_.scala.Option[_root_.scala.Predef.String] = Some(value)
      override def number: _root_.scala.Int = 4
    }
  }
  implicit class DataEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.wavesplatform.database.protobuf.DataEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.wavesplatform.database.protobuf.DataEntry](_l) {
    def intValue: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.getIntValue)((c_, f_) => c_.copy(value = com.wavesplatform.database.protobuf.DataEntry.Value.IntValue(f_)))
    def boolValue: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.getBoolValue)((c_, f_) => c_.copy(value = com.wavesplatform.database.protobuf.DataEntry.Value.BoolValue(f_)))
    def binaryValue: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.getBinaryValue)((c_, f_) => c_.copy(value = com.wavesplatform.database.protobuf.DataEntry.Value.BinaryValue(f_)))
    def stringValue: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.getStringValue)((c_, f_) => c_.copy(value = com.wavesplatform.database.protobuf.DataEntry.Value.StringValue(f_)))
    def value: _root_.scalapb.lenses.Lens[UpperPB, com.wavesplatform.database.protobuf.DataEntry.Value] = field(_.value)((c_, f_) => c_.copy(value = f_))
  }
  final val INT_VALUE_FIELD_NUMBER = 1
  final val BOOL_VALUE_FIELD_NUMBER = 2
  final val BINARY_VALUE_FIELD_NUMBER = 3
  final val STRING_VALUE_FIELD_NUMBER = 4
  def of(
    value: com.wavesplatform.database.protobuf.DataEntry.Value
  ): _root_.com.wavesplatform.database.protobuf.DataEntry = _root_.com.wavesplatform.database.protobuf.DataEntry(
    value
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[waves.api.DataEntry])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy