flatMap<R> method

Try<R, Failure> flatMap<R>(
  1. Try<R, Failure> transform(
    1. Success value
    )
)

Implementation

Try<R, Failure> flatMap<R>(
    Try<R, Failure> Function(Success value) transform) {
  if (isSuccess) {
    return transform(getOrThrow());
  } else {
    return Try.failure(exceptionOrNull());
  }
}