getOrElse

inline fun <R, S : R, F> Try<S, F>.getOrElse(onFailure: (exception: F) -> R): R

Returns the encapsulated value if this instance represents success or the result of onFailure function for the encapsulated value if it is failure.