com.wavesplatform.protobuf.transaction.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.protobuf.transaction
@SerialVersionUID(0L)
final case class DataEntry(
key: _root_.scala.Predef.String = "",
value: com.wavesplatform.protobuf.transaction.DataEntry.Value = com.wavesplatform.protobuf.transaction.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
{
val __value = key
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
}
};
if (value.intValue.isDefined) {
val __value = value.intValue.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(10, __value)
};
if (value.boolValue.isDefined) {
val __value = value.boolValue.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(11, __value)
};
if (value.binaryValue.isDefined) {
val __value = value.binaryValue.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(12, __value)
};
if (value.stringValue.isDefined) {
val __value = value.stringValue.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(13, __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 = key
if (!__v.isEmpty) {
_output__.writeString(1, __v)
}
};
value.intValue.foreach { __v =>
val __m = __v
_output__.writeInt64(10, __m)
};
value.boolValue.foreach { __v =>
val __m = __v
_output__.writeBool(11, __m)
};
value.binaryValue.foreach { __v =>
val __m = __v
_output__.writeBytes(12, __m)
};
value.stringValue.foreach { __v =>
val __m = __v
_output__.writeString(13, __m)
};
unknownFields.writeTo(_output__)
}
def withKey(__v: _root_.scala.Predef.String): DataEntry = copy(key = __v)
def getIntValue: _root_.scala.Long = value.intValue.getOrElse(0L)
def withIntValue(__v: _root_.scala.Long): DataEntry = copy(value = com.wavesplatform.protobuf.transaction.DataEntry.Value.IntValue(__v))
def getBoolValue: _root_.scala.Boolean = value.boolValue.getOrElse(false)
def withBoolValue(__v: _root_.scala.Boolean): DataEntry = copy(value = com.wavesplatform.protobuf.transaction.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.protobuf.transaction.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.protobuf.transaction.DataEntry.Value.StringValue(__v))
def clearValue: DataEntry = copy(value = com.wavesplatform.protobuf.transaction.DataEntry.Value.Empty)
def withValue(__v: com.wavesplatform.protobuf.transaction.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 => {
val __t = key
if (__t != "") __t else null
}
case 10 => value.intValue.orNull
case 11 => value.boolValue.orNull
case 12 => value.binaryValue.orNull
case 13 => 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 => _root_.scalapb.descriptors.PString(key)
case 10 => value.intValue.map(_root_.scalapb.descriptors.PLong(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 11 => value.boolValue.map(_root_.scalapb.descriptors.PBoolean(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 12 => value.binaryValue.map(_root_.scalapb.descriptors.PByteString(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 13 => 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.protobuf.transaction.DataEntry.type = com.wavesplatform.protobuf.transaction.DataEntry
// @@protoc_insertion_point(GeneratedMessage[waves.DataEntry])
}
object DataEntry extends scalapb.GeneratedMessageCompanion[com.wavesplatform.protobuf.transaction.DataEntry] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.wavesplatform.protobuf.transaction.DataEntry] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.wavesplatform.protobuf.transaction.DataEntry = {
var __key: _root_.scala.Predef.String = ""
var __value: com.wavesplatform.protobuf.transaction.DataEntry.Value = com.wavesplatform.protobuf.transaction.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 10 =>
__key = _input__.readStringRequireUtf8()
case 80 =>
__value = com.wavesplatform.protobuf.transaction.DataEntry.Value.IntValue(_input__.readInt64())
case 88 =>
__value = com.wavesplatform.protobuf.transaction.DataEntry.Value.BoolValue(_input__.readBool())
case 98 =>
__value = com.wavesplatform.protobuf.transaction.DataEntry.Value.BinaryValue(_input__.readBytes())
case 106 =>
__value = com.wavesplatform.protobuf.transaction.DataEntry.Value.StringValue(_input__.readStringRequireUtf8())
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
com.wavesplatform.protobuf.transaction.DataEntry(
key = __key,
value = __value,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[com.wavesplatform.protobuf.transaction.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.protobuf.transaction.DataEntry(
key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Long]]).map(com.wavesplatform.protobuf.transaction.DataEntry.Value.IntValue(_))
.orElse[com.wavesplatform.protobuf.transaction.DataEntry.Value](__fieldsMap.get(scalaDescriptor.findFieldByNumber(11).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]]).map(com.wavesplatform.protobuf.transaction.DataEntry.Value.BoolValue(_)))
.orElse[com.wavesplatform.protobuf.transaction.DataEntry.Value](__fieldsMap.get(scalaDescriptor.findFieldByNumber(12).get).flatMap(_.as[_root_.scala.Option[_root_.com.google.protobuf.ByteString]]).map(com.wavesplatform.protobuf.transaction.DataEntry.Value.BinaryValue(_)))
.orElse[com.wavesplatform.protobuf.transaction.DataEntry.Value](__fieldsMap.get(scalaDescriptor.findFieldByNumber(13).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Predef.String]]).map(com.wavesplatform.protobuf.transaction.DataEntry.Value.StringValue(_)))
.getOrElse(com.wavesplatform.protobuf.transaction.DataEntry.Value.Empty)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = TransactionProto.javaDescriptor.getMessageTypes().get(6)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = TransactionProto.scalaDescriptor.messages(6)
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.protobuf.transaction.DataEntry(
key = "",
value = com.wavesplatform.protobuf.transaction.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.protobuf.transaction.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.protobuf.transaction.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 = 10
}
@SerialVersionUID(0L)
final case class BoolValue(value: _root_.scala.Boolean) extends com.wavesplatform.protobuf.transaction.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 = 11
}
@SerialVersionUID(0L)
final case class BinaryValue(value: _root_.com.google.protobuf.ByteString) extends com.wavesplatform.protobuf.transaction.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 = 12
}
@SerialVersionUID(0L)
final case class StringValue(value: _root_.scala.Predef.String) extends com.wavesplatform.protobuf.transaction.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 = 13
}
}
implicit class DataEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.wavesplatform.protobuf.transaction.DataEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.wavesplatform.protobuf.transaction.DataEntry](_l) {
def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_))
def intValue: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.getIntValue)((c_, f_) => c_.copy(value = com.wavesplatform.protobuf.transaction.DataEntry.Value.IntValue(f_)))
def boolValue: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.getBoolValue)((c_, f_) => c_.copy(value = com.wavesplatform.protobuf.transaction.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.protobuf.transaction.DataEntry.Value.BinaryValue(f_)))
def stringValue: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.getStringValue)((c_, f_) => c_.copy(value = com.wavesplatform.protobuf.transaction.DataEntry.Value.StringValue(f_)))
def value: _root_.scalapb.lenses.Lens[UpperPB, com.wavesplatform.protobuf.transaction.DataEntry.Value] = field(_.value)((c_, f_) => c_.copy(value = f_))
}
final val KEY_FIELD_NUMBER = 1
final val INT_VALUE_FIELD_NUMBER = 10
final val BOOL_VALUE_FIELD_NUMBER = 11
final val BINARY_VALUE_FIELD_NUMBER = 12
final val STRING_VALUE_FIELD_NUMBER = 13
def of(
key: _root_.scala.Predef.String,
value: com.wavesplatform.protobuf.transaction.DataEntry.Value
): _root_.com.wavesplatform.protobuf.transaction.DataEntry = _root_.com.wavesplatform.protobuf.transaction.DataEntry(
key,
value
)
// @@protoc_insertion_point(GeneratedMessageCompanion[waves.DataEntry])
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy