Class/Object

com.twitter.util

Throw

Related Docs: object Throw | package util

Permalink

final case class Throw[+R](e: Throwable) extends Try[R] with Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, Equals, Try[R], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Throw
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Try
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Throw(e: Throwable)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def andThen[R2](f: (R) ⇒ Try[R2]): Try[R2]

    Permalink

    Returns the given function applied to the value from this Return or returns this if this is a Throw.

    Returns the given function applied to the value from this Return or returns this if this is a Throw. Alias for flatMap

    Definition Classes
    Try
  5. def apply(): R

    Permalink

    Returns the value from this Return or throws the exception if this is a Throw

    Returns the value from this Return or throws the exception if this is a Throw

    Definition Classes
    ThrowTry
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def asScala: scala.util.Try[R]

    Permalink

    Convert to a scala.util.Try

    Convert to a scala.util.Try

    Definition Classes
    ThrowTry
  8. def cast[X]: Try[X]

    Permalink
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val e: Throwable

    Permalink
  11. def ensure(f: ⇒ Unit): Try[R]

    Permalink

    Invoked regardless of whether the computation completed successfully or unsuccessfully.

    Invoked regardless of whether the computation completed successfully or unsuccessfully. Implemented in terms of respond so that subclasses control evaluation order. Returns a chained this as in respond.

    Definition Classes
    Try
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def exists(p: (R) ⇒ Boolean): Boolean

    Permalink

    Returns true if this Try is a Return and the predicate p returns true when applied to its value.

    Returns true if this Try is a Return and the predicate p returns true when applied to its value.

    Definition Classes
    ThrowTry
  14. def filter(p: (R) ⇒ Boolean): Throw[R]

    Permalink

    Converts this to a Throw if the predicate does not obtain.

    Converts this to a Throw if the predicate does not obtain.

    Definition Classes
    ThrowTry
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def flatMap[R2](f: (R) ⇒ Try[R2]): Throw[R2]

    Permalink

    Returns the given function applied to the value from this Return or returns this if this is a Throw.

    Returns the given function applied to the value from this Return or returns this if this is a Throw.

    Note The gnarly type parameterization is there for Java compatibility, since Java does not support higher-kinded types.

    Definition Classes
    ThrowTry
  17. def flatten[T](implicit ev: <:<[R, Try[T]]): Try[T]

    Permalink
    Definition Classes
    ThrowTry
  18. def foreach(f: (R) ⇒ Unit): Unit

    Permalink

    Applies the given function f if this is a Result.

    Applies the given function f if this is a Result.

    Definition Classes
    Try
  19. def get(): R

    Permalink

    Returns the value from this Return or throws the exception if this is a Throw.

    Returns the value from this Return or throws the exception if this is a Throw. Alias for apply()

    Definition Classes
    Try
  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def getOrElse[R2 >: R](default: ⇒ R2): R2

    Permalink

    Returns the value from this Return or the given argument if this is a Throw.

    Returns the value from this Return or the given argument if this is a Throw.

    Definition Classes
    Try
  22. def handle[R2 >: R](rescueException: PartialFunction[Throwable, R2]): Try[R2]

    Permalink

    Calls the exceptionHandler with the exception if this is a Throw.

    Calls the exceptionHandler with the exception if this is a Throw. This is like map for the exception.

    Definition Classes
    ThrowTry
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def isReturn: Boolean

    Permalink

    Returns true if the Try is a Return, false otherwise.

    Returns true if the Try is a Return, false otherwise.

    Definition Classes
    ThrowTry
  25. def isThrow: Boolean

    Permalink

    Returns true if the Try is a Throw, false otherwise.

    Returns true if the Try is a Throw, false otherwise.

    Definition Classes
    ThrowTry
  26. def map[X](f: (R) ⇒ X): Try[X]

    Permalink

    Maps the given function to the value from this Return or returns this if this is a Throw

    Maps the given function to the value from this Return or returns this if this is a Throw

    Definition Classes
    ThrowTry
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. def onFailure(rescueException: (Throwable) ⇒ Unit): Throw[R]

    Permalink

    Invoke the function on the error, if the computation was unsuccessful.

    Invoke the function on the error, if the computation was unsuccessful. Returns a chained this as in respond.

    Definition Classes
    ThrowTry
  31. def onSuccess(f: (R) ⇒ Unit): Throw[R]

    Permalink

    Invoked only if the computation was successful.

    Invoked only if the computation was successful. Returns a chained this as in respond.

    Definition Classes
    ThrowTry
  32. def rescue[R2 >: R](rescueException: PartialFunction[Throwable, Try[R2]]): Try[R2]

    Permalink

    Calls the exceptionHandler with the exception if this is a Throw.

    Calls the exceptionHandler with the exception if this is a Throw. This is like flatMap for the exception.

    Note The gnarly type parameterization is there for Java compatibility, since Java does not support higher-kinded types.

    Definition Classes
    ThrowTry
  33. def respond(k: (Try[R]) ⇒ Unit): Try[R]

    Permalink

    Invokes the given closure when the value is available.

    Invokes the given closure when the value is available. Returns another 'This[R]' that is guaranteed to be available only *after* 'k' has run. This enables the enforcement of invocation ordering.

    Definition Classes
    Try
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def throwable: Throwable

    Permalink

    Returns the throwable if this is a Throw, else raises IllegalStateException.

    Returns the throwable if this is a Throw, else raises IllegalStateException.

    Callers should consult isThrow() prior to calling this method to determine whether or not this is a Throw.

    This method is intended for Java compatibility. Scala consumers are encouraged to pattern match for Throw(t).

    Definition Classes
    ThrowTry
  36. def toOption: Option[R]

    Permalink

    Returns None if this is a Throw or a Some containing the value if this is a Return

    Returns None if this is a Throw or a Some containing the value if this is a Return

    Definition Classes
    Try
  37. def transform[R2](f: (Try[R]) ⇒ Try[R2]): Try[R2]

    Permalink

    Invokes the given transformation when the value is available, returning the transformed value.

    Invokes the given transformation when the value is available, returning the transformed value. This method is like a combination of flatMap and rescue. This method is typically used for more imperative control-flow than flatMap/rescue which often exploits the Null Object Pattern.

    Definition Classes
    Try
  38. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def withFilter(p: (R) ⇒ Boolean): Throw[R]

    Permalink

    Converts this to a Throw if the predicate does not obtain.

    Converts this to a Throw if the predicate does not obtain.

    Definition Classes
    ThrowTry

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Try[R]

Inherited from AnyRef

Inherited from Any

Ungrouped