corda / net.corda.core.utilities / Try / Failure

Failure

data class Failure<out A> : Try<A>

Constructors

<init>

Failure(exception: Throwable)

Properties

exception

val exception: Throwable

isFailure

val isFailure: Boolean

Returns true iff the Try is a Success.

isSuccess

val isSuccess: Boolean

Returns true iff the Try is a Failure.

Functions

getOrThrow

fun getOrThrow(): A

Returns the value if a Success otherwise throws the exception if a Failure.

toString

fun toString(): String

Inherited Functions

combine

fun <B, C> combine(other: Try<B>, function: (A, B) -> C): Try<C>

Maps the given function to the values from this Success and other, or returns this if this is a Failure or other if other is a Failure.

flatMap

fun <B> flatMap(function: (A) -> Try<B>): Try<B>

Returns the given function applied to the value from this Success, or returns this if this is a Failure.

map

fun <B> map(function: (A) -> B): Try<B>

Maps the given function to the value from this Success, or returns this if this is a Failure.