class Failure<T : Any!> : Try<T>
Represents a failed computation that resulted in a Throwable
.
fun <R : Any!> cast(clazz: Class<R>): Try<R>! |
|
fun equals(other: Any?): Boolean |
|
fun filter(predicate: Predicate<in T>, ignored: Supplier<out Throwable!>): Try<T>! |
|
fun <R : Any!> flatMap(ignored: (in T) -> out Try<out R>!): Try<R>! |
|
fun get(): T |
|
fun getCause(): Throwable! |
|
fun getChecked(): T |
|
fun getOrElse(defaultValue: T?): T |
|
fun hashCode(): Int |
|
fun ifFailure(action: Consumer1<Throwable!>): Try<T>! |
|
fun ifSuccess(ignored: Consumer1<in T>): Try<T>! |
|
fun isSuccess(): Boolean |
|
fun <R : Any!> map(ignored: (in T) -> out R): Try<R>! |
|
fun <R : Any!> onBoth(other: Try<out R>, action: Consumer2<in T, in R>): Try<T> fun <R : Any!> onBoth(otherSupplier: Supplier<Try<R>!>, action: Consumer2<in T, in R>): Try<T> |
|
fun orElse(defaultTry: Try<T>): Try<T>! fun orElse(supplier: Supplier<Try<T>!>): Try<T>! |
|
fun recover(function: (in Throwable!) -> out T): Try<T>! |
|
fun recoverWith(function: (in Throwable!) -> Try<out T>!): Try<T>! |
|
fun <R : Any!, S : Any!> zipWith(other: Try<out S>, zipper: (in T, in S) -> out R): Try<R> |
open static fun <R : Any!> failure(throwable: Throwable): Try<R>
Creates a |
|
open fun filter(predicate: Predicate<in T>): Try<T>!
Returns a |
|
open fun getOrElse(provider: (in Throwable!) -> T): T
Returns |
|
open fun <E : Throwable!> getOrElseThrow(): T
Returns open fun <E : Throwable!> getOrElseThrow(provider: (in Throwable!) -> E): T
Returns |
|
open fun getOrNull(): T
Returns a |
|
open fun isFailure(): Boolean
|
|
open fun iterator(): MutableIterator<T> |
|
open static fun <R : Any!> of(supplier: Supplier<out R>): Try<R>
Creates a |
|
open static fun <R : Any!> ofChecked(supplier: CheckedSupplier<out R>): Try<R>
Creates a |
|
open static fun <R : Any!> ofFailure(supplier: Supplier<out Throwable!>): Try<R>
Creates a |
|
open static fun <R : Any!> ofNullable(value: R?): Try<R>
Creates a open static fun <R : Any!> ofNullable(value: R?, exception: Exception!): Try<R>
Creates a |
|
open static fun <R : Any!> success(value: R): Try<R>
Creates a |
|
open static fun <R : Any!> unit(): (R) -> Try<R>!
Returns a function that takes a value and returns a monad of that value. The returned function will always return a |
|
open static fun <R : Any!> when(condition: Boolean, value: R): Try<R>
Creates a open static fun <R : Any!> when(condition: Boolean, supplier: Supplier<out R>): Try<R>
Lazy equivalent of open static fun <R : Any!> when(conditionSupplier: Supplier<Boolean!>, valueSupplier: Supplier<out R>, errorSupplier: Supplier<out Throwable!>): Try<R>! |