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

scalapb.endless.transaction.proto.model.Status.scala Maven / Gradle / Ivy

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

package endless.transaction.proto.model

@SerialVersionUID(0L)
final case class Status(
    status: endless.transaction.proto.model.Status.Status = endless.transaction.proto.model.Status.Status.Empty,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage {
    @transient
    private var __serializedSizeMemoized: _root_.scala.Int = 0
    private def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      if (status.preparing.isDefined) {
        val __value = status.preparing.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (status.committing.isDefined) {
        val __value = status.committing.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (status.committed.isDefined) {
        val __value = status.committed.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (status.aborting.isDefined) {
        val __value = status.aborting.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (status.aborted.isDefined) {
        val __value = status.aborted.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (status.failed.isDefined) {
        val __value = status.failed.get
        __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 = {
      status.preparing.foreach { __v =>
        val __m = __v
        _output__.writeTag(1, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      status.committing.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      status.committed.foreach { __v =>
        val __m = __v
        _output__.writeTag(3, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      status.aborting.foreach { __v =>
        val __m = __v
        _output__.writeTag(4, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      status.aborted.foreach { __v =>
        val __m = __v
        _output__.writeTag(5, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      status.failed.foreach { __v =>
        val __m = __v
        _output__.writeTag(6, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def getPreparing: endless.transaction.proto.model.Preparing = status.preparing.getOrElse(endless.transaction.proto.model.Preparing.defaultInstance)
    def withPreparing(__v: endless.transaction.proto.model.Preparing): Status = copy(status = endless.transaction.proto.model.Status.Status.Preparing(__v))
    def getCommitting: endless.transaction.proto.model.Committing = status.committing.getOrElse(endless.transaction.proto.model.Committing.defaultInstance)
    def withCommitting(__v: endless.transaction.proto.model.Committing): Status = copy(status = endless.transaction.proto.model.Status.Status.Committing(__v))
    def getCommitted: endless.transaction.proto.model.Committed = status.committed.getOrElse(endless.transaction.proto.model.Committed.defaultInstance)
    def withCommitted(__v: endless.transaction.proto.model.Committed): Status = copy(status = endless.transaction.proto.model.Status.Status.Committed(__v))
    def getAborting: endless.transaction.proto.model.Aborting = status.aborting.getOrElse(endless.transaction.proto.model.Aborting.defaultInstance)
    def withAborting(__v: endless.transaction.proto.model.Aborting): Status = copy(status = endless.transaction.proto.model.Status.Status.Aborting(__v))
    def getAborted: endless.transaction.proto.model.Aborted = status.aborted.getOrElse(endless.transaction.proto.model.Aborted.defaultInstance)
    def withAborted(__v: endless.transaction.proto.model.Aborted): Status = copy(status = endless.transaction.proto.model.Status.Status.Aborted(__v))
    def getFailed: endless.transaction.proto.model.Failed = status.failed.getOrElse(endless.transaction.proto.model.Failed.defaultInstance)
    def withFailed(__v: endless.transaction.proto.model.Failed): Status = copy(status = endless.transaction.proto.model.Status.Status.Failed(__v))
    def clearStatus: Status = copy(status = endless.transaction.proto.model.Status.Status.Empty)
    def withStatus(__v: endless.transaction.proto.model.Status.Status): Status = copy(status = __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 => status.preparing.orNull
        case 2 => status.committing.orNull
        case 3 => status.committed.orNull
        case 4 => status.aborting.orNull
        case 5 => status.aborted.orNull
        case 6 => status.failed.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 => status.preparing.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 2 => status.committing.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 3 => status.committed.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 4 => status.aborting.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 5 => status.aborted.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 6 => status.failed.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: endless.transaction.proto.model.Status.type = endless.transaction.proto.model.Status
    // @@protoc_insertion_point(GeneratedMessage[endless.transaction.proto.Status])
}

object Status extends scalapb.GeneratedMessageCompanion[endless.transaction.proto.model.Status] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[endless.transaction.proto.model.Status] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): endless.transaction.proto.model.Status = {
    var __status: endless.transaction.proto.model.Status.Status = endless.transaction.proto.model.Status.Status.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 =>
          __status = endless.transaction.proto.model.Status.Status.Preparing(__status.preparing.fold(_root_.scalapb.LiteParser.readMessage[endless.transaction.proto.model.Preparing](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 18 =>
          __status = endless.transaction.proto.model.Status.Status.Committing(__status.committing.fold(_root_.scalapb.LiteParser.readMessage[endless.transaction.proto.model.Committing](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 26 =>
          __status = endless.transaction.proto.model.Status.Status.Committed(__status.committed.fold(_root_.scalapb.LiteParser.readMessage[endless.transaction.proto.model.Committed](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 34 =>
          __status = endless.transaction.proto.model.Status.Status.Aborting(__status.aborting.fold(_root_.scalapb.LiteParser.readMessage[endless.transaction.proto.model.Aborting](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 42 =>
          __status = endless.transaction.proto.model.Status.Status.Aborted(__status.aborted.fold(_root_.scalapb.LiteParser.readMessage[endless.transaction.proto.model.Aborted](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 50 =>
          __status = endless.transaction.proto.model.Status.Status.Failed(__status.failed.fold(_root_.scalapb.LiteParser.readMessage[endless.transaction.proto.model.Failed](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    endless.transaction.proto.model.Status(
        status = __status,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[endless.transaction.proto.model.Status] = _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.")
      endless.transaction.proto.model.Status(
        status = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[endless.transaction.proto.model.Preparing]]).map(endless.transaction.proto.model.Status.Status.Preparing(_))
            .orElse[endless.transaction.proto.model.Status.Status](__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[endless.transaction.proto.model.Committing]]).map(endless.transaction.proto.model.Status.Status.Committing(_)))
            .orElse[endless.transaction.proto.model.Status.Status](__fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[endless.transaction.proto.model.Committed]]).map(endless.transaction.proto.model.Status.Status.Committed(_)))
            .orElse[endless.transaction.proto.model.Status.Status](__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[endless.transaction.proto.model.Aborting]]).map(endless.transaction.proto.model.Status.Status.Aborting(_)))
            .orElse[endless.transaction.proto.model.Status.Status](__fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).flatMap(_.as[_root_.scala.Option[endless.transaction.proto.model.Aborted]]).map(endless.transaction.proto.model.Status.Status.Aborted(_)))
            .orElse[endless.transaction.proto.model.Status.Status](__fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).flatMap(_.as[_root_.scala.Option[endless.transaction.proto.model.Failed]]).map(endless.transaction.proto.model.Status.Status.Failed(_)))
            .getOrElse(endless.transaction.proto.model.Status.Status.Empty)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ModelProto.javaDescriptor.getMessageTypes().get(7)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ModelProto.scalaDescriptor.messages(7)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[?] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[?] = null
    (__number: @_root_.scala.unchecked) match {
      case 1 => __out = endless.transaction.proto.model.Preparing
      case 2 => __out = endless.transaction.proto.model.Committing
      case 3 => __out = endless.transaction.proto.model.Committed
      case 4 => __out = endless.transaction.proto.model.Aborting
      case 5 => __out = endless.transaction.proto.model.Aborted
      case 6 => __out = endless.transaction.proto.model.Failed
    }
    __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 = endless.transaction.proto.model.Status(
    status = endless.transaction.proto.model.Status.Status.Empty
  )
  sealed trait Status extends _root_.scalapb.GeneratedOneof {
    def isEmpty: _root_.scala.Boolean = false
    def isDefined: _root_.scala.Boolean = true
    def isPreparing: _root_.scala.Boolean = false
    def isCommitting: _root_.scala.Boolean = false
    def isCommitted: _root_.scala.Boolean = false
    def isAborting: _root_.scala.Boolean = false
    def isAborted: _root_.scala.Boolean = false
    def isFailed: _root_.scala.Boolean = false
    def preparing: _root_.scala.Option[endless.transaction.proto.model.Preparing] = _root_.scala.None
    def committing: _root_.scala.Option[endless.transaction.proto.model.Committing] = _root_.scala.None
    def committed: _root_.scala.Option[endless.transaction.proto.model.Committed] = _root_.scala.None
    def aborting: _root_.scala.Option[endless.transaction.proto.model.Aborting] = _root_.scala.None
    def aborted: _root_.scala.Option[endless.transaction.proto.model.Aborted] = _root_.scala.None
    def failed: _root_.scala.Option[endless.transaction.proto.model.Failed] = _root_.scala.None
  }
  object Status {
    @SerialVersionUID(0L)
    case object Empty extends endless.transaction.proto.model.Status.Status {
      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 Preparing(value: endless.transaction.proto.model.Preparing) extends endless.transaction.proto.model.Status.Status {
      type ValueType = endless.transaction.proto.model.Preparing
      override def isPreparing: _root_.scala.Boolean = true
      override def preparing: _root_.scala.Option[endless.transaction.proto.model.Preparing] = Some(value)
      override def number: _root_.scala.Int = 1
    }
    @SerialVersionUID(0L)
    final case class Committing(value: endless.transaction.proto.model.Committing) extends endless.transaction.proto.model.Status.Status {
      type ValueType = endless.transaction.proto.model.Committing
      override def isCommitting: _root_.scala.Boolean = true
      override def committing: _root_.scala.Option[endless.transaction.proto.model.Committing] = Some(value)
      override def number: _root_.scala.Int = 2
    }
    @SerialVersionUID(0L)
    final case class Committed(value: endless.transaction.proto.model.Committed) extends endless.transaction.proto.model.Status.Status {
      type ValueType = endless.transaction.proto.model.Committed
      override def isCommitted: _root_.scala.Boolean = true
      override def committed: _root_.scala.Option[endless.transaction.proto.model.Committed] = Some(value)
      override def number: _root_.scala.Int = 3
    }
    @SerialVersionUID(0L)
    final case class Aborting(value: endless.transaction.proto.model.Aborting) extends endless.transaction.proto.model.Status.Status {
      type ValueType = endless.transaction.proto.model.Aborting
      override def isAborting: _root_.scala.Boolean = true
      override def aborting: _root_.scala.Option[endless.transaction.proto.model.Aborting] = Some(value)
      override def number: _root_.scala.Int = 4
    }
    @SerialVersionUID(0L)
    final case class Aborted(value: endless.transaction.proto.model.Aborted) extends endless.transaction.proto.model.Status.Status {
      type ValueType = endless.transaction.proto.model.Aborted
      override def isAborted: _root_.scala.Boolean = true
      override def aborted: _root_.scala.Option[endless.transaction.proto.model.Aborted] = Some(value)
      override def number: _root_.scala.Int = 5
    }
    @SerialVersionUID(0L)
    final case class Failed(value: endless.transaction.proto.model.Failed) extends endless.transaction.proto.model.Status.Status {
      type ValueType = endless.transaction.proto.model.Failed
      override def isFailed: _root_.scala.Boolean = true
      override def failed: _root_.scala.Option[endless.transaction.proto.model.Failed] = Some(value)
      override def number: _root_.scala.Int = 6
    }
  }
  final val PREPARING_FIELD_NUMBER = 1
  final val COMMITTING_FIELD_NUMBER = 2
  final val COMMITTED_FIELD_NUMBER = 3
  final val ABORTING_FIELD_NUMBER = 4
  final val ABORTED_FIELD_NUMBER = 5
  final val FAILED_FIELD_NUMBER = 6
  def of(
    status: endless.transaction.proto.model.Status.Status
  ): _root_.endless.transaction.proto.model.Status = _root_.endless.transaction.proto.model.Status(
    status
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[endless.transaction.proto.Status])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy