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

com.twitter.finagle.zipkin.thriftscala.ResultCode.scala Maven / Gradle / Ivy

There is a newer version: 18.2.0
Show newest version
/**
 * Generated by Scrooge
 *   version: 4.10.0
 *   rev: 93b5383f7afff1301467b8941baf6ab35959a15c
 *   built at: 20160907-143258
 */
package com.twitter.finagle.zipkin.thriftscala

import com.twitter.scrooge.ThriftEnum


@javax.annotation.Generated(value = Array("com.twitter.scrooge.Compiler"))
case object ResultCode {
  
  case object Ok extends com.twitter.finagle.zipkin.thriftscala.ResultCode {
    val value: Int = 0
    val name: String = "Ok"
    val originalName: String = "OK"
  }

  private[this] val _SomeOk = _root_.scala.Some(com.twitter.finagle.zipkin.thriftscala.ResultCode.Ok)
  
  case object TryLater extends com.twitter.finagle.zipkin.thriftscala.ResultCode {
    val value: Int = 1
    val name: String = "TryLater"
    val originalName: String = "TRY_LATER"
  }

  private[this] val _SomeTryLater = _root_.scala.Some(com.twitter.finagle.zipkin.thriftscala.ResultCode.TryLater)

  case class EnumUnknownResultCode(value: Int) extends com.twitter.finagle.zipkin.thriftscala.ResultCode {
    val name: String = "EnumUnknownResultCode" + value
    def originalName: String = name
  }

  /**
   * Find the enum by its integer value, as defined in the Thrift IDL.
   * @throws NoSuchElementException if the value is not found.
   */
  def apply(value: Int): com.twitter.finagle.zipkin.thriftscala.ResultCode =
    value match {
      case 0 => com.twitter.finagle.zipkin.thriftscala.ResultCode.Ok
      case 1 => com.twitter.finagle.zipkin.thriftscala.ResultCode.TryLater
      case _ => throw new NoSuchElementException(value.toString)
    }

  /**
   * Find the enum by its integer value, as defined in the Thrift IDL.
   * returns an EnumUnknownResultCode(value) if the value is not found.
   * In particular this allows ignoring new values added to an enum
   * in the IDL on the producer side when the consumer was not updated.
   */
  def getOrUnknown(value: Int): com.twitter.finagle.zipkin.thriftscala.ResultCode =
    get(value) match {
      case _root_.scala.Some(e) => e
      case _root_.scala.None => EnumUnknownResultCode(value)
    }

  /**
   * Find the enum by its integer value, as defined in the Thrift IDL.
   * Returns None if the value is not found
   */
  def get(value: Int): _root_.scala.Option[com.twitter.finagle.zipkin.thriftscala.ResultCode] =
    value match {
      case 0 => _SomeOk
      case 1 => _SomeTryLater
      case _ => _root_.scala.None
    }

  def valueOf(name: String): _root_.scala.Option[com.twitter.finagle.zipkin.thriftscala.ResultCode] =
    name.toLowerCase match {
      case "ok" => _SomeOk
      case "trylater" => _SomeTryLater
      case _ => _root_.scala.None
    }

  lazy val list: List[com.twitter.finagle.zipkin.thriftscala.ResultCode] = scala.List[com.twitter.finagle.zipkin.thriftscala.ResultCode](
    com.twitter.finagle.zipkin.thriftscala.ResultCode.Ok,
    com.twitter.finagle.zipkin.thriftscala.ResultCode.TryLater
  )
}



@javax.annotation.Generated(value = Array("com.twitter.scrooge.Compiler"))
sealed trait ResultCode extends ThriftEnum with Serializable




© 2015 - 2025 Weber Informatics LLC | Privacy Policy