final case class Return[+R](r: R) extends Try[R] with Product with Serializable
- Alphabetic
- By Inheritance
- Return
- Serializable
- Product
- Equals
- Try
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Return(r: R)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def andThen[R2](f: (R) => Try[R2]): Try[R2]
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
- def apply(): R
Returns the value from this Return or throws the exception if this is a Throw
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asScala: scala.util.Try[R]
Convert to a scala.util.Try
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ensure(f: => Unit): Try[R]
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 chainedthis
as inrespond
.- Definition Classes
- Try
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def exists(p: (R) => Boolean): Boolean
Returns true if this Try is a Return and the predicate p returns true when applied to its value.
- def filter(p: (R) => Boolean): Try[R]
Converts this to a Throw if the predicate does not obtain.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def flatMap[R2](f: (R) => Try[R2]): Try[R2]
Returns the given function applied to the value from this Return or returns this if this is a Throw.
- def flatten[T](implicit ev: <:<[R, Try[T]]): Try[T]
- def foreach(f: (R) => Unit): Unit
Applies the given function f if this is a Result.
Applies the given function f if this is a Result.
- Definition Classes
- Try
- def get(): R
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
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getOrElse[R2 >: R](default: => R2): R2
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
- def handle[R2 >: R](rescueException: PartialFunction[Throwable, R2]): Try[R2]
Calls the exceptionHandler with the exception if this is a Throw.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isReturn: Boolean
Returns true if the Try is a Return, false otherwise.
- def isThrow: Boolean
Returns true if the Try is a Throw, false otherwise.
- def map[X](f: (R) => X): Try[X]
Maps the given function to the value from this Return or returns this if this is a Throw
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def onFailure(rescueException: (Throwable) => Unit): Try[R]
Invoke the function on the error, if the computation was unsuccessful.
- def onSuccess(f: (R) => Unit): Try[R]
Invoked only if the computation was successful.
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val r: R
- def rescue[R2 >: R](rescueException: PartialFunction[Throwable, Try[R2]]): Try[R2]
Calls the exceptionHandler with the exception if this is a Throw.
- def respond(k: (Try[R]) => Unit): Try[R]
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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def throwable: Throwable
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).
- def toOption: Option[R]
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
- def transform[R2](f: (Try[R]) => Try[R2]): Try[R2]
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
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withFilter(p: (R) => Boolean): Try[R]
Converts this to a Throw if the predicate does not obtain.