org.plasmalabs.indexer.services.TxoState.scala Maven / Gradle / Ivy
The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package org.plasmalabs.indexer.services
/** Used to identify the status of a Txo.
*/
sealed abstract class TxoState(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
type EnumType = org.plasmalabs.indexer.services.TxoState
type RecognizedType = org.plasmalabs.indexer.services.TxoState.Recognized
def isSpent: _root_.scala.Boolean = false
def isUnspent: _root_.scala.Boolean = false
def isPending: _root_.scala.Boolean = false
def companion: _root_.scalapb.GeneratedEnumCompanion[TxoState] = org.plasmalabs.indexer.services.TxoState
final def asRecognized: _root_.scala.Option[org.plasmalabs.indexer.services.TxoState.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[org.plasmalabs.indexer.services.TxoState.Recognized])
}
object TxoState extends _root_.scalapb.GeneratedEnumCompanion[TxoState] {
sealed trait Recognized extends TxoState
implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[TxoState] = this
/** The TxO is spent
*/
@SerialVersionUID(0L)
case object SPENT extends TxoState(0) with TxoState.Recognized {
val index = 0
val name = "SPENT"
override def isSpent: _root_.scala.Boolean = true
}
/** The TxO is not spent
*/
@SerialVersionUID(0L)
case object UNSPENT extends TxoState(1) with TxoState.Recognized {
val index = 1
val name = "UNSPENT"
override def isUnspent: _root_.scala.Boolean = true
}
/** A transaction is pending that may spend the TXO. This state should only appear in node clients.
*/
@SerialVersionUID(0L)
case object PENDING extends TxoState(2) with TxoState.Recognized {
val index = 2
val name = "PENDING"
override def isPending: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends TxoState(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
lazy val values: scala.collection.immutable.Seq[ValueType] = scala.collection.immutable.Seq(SPENT, UNSPENT, PENDING)
def fromValue(__value: _root_.scala.Int): TxoState = __value match {
case 0 => SPENT
case 1 => UNSPENT
case 2 => PENDING
case __other => Unrecognized(__other)
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = IndexerModelsProto.javaDescriptor.getEnumTypes().get(0)
def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = IndexerModelsProto.scalaDescriptor.enums(0)
}