sdk-common / com.tomtom.online.sdk.common.functional / Try / ofFailure

ofFailure

@NonNull open static fun <R : Any!> ofFailure(@NonNull supplier: Supplier<out Throwable!>): Try<R>

Creates a Failure from a given Supplier that returns a Throwable.

Parameters

supplier - Supplier<out Throwable!>: returns a Throwable, cannot be null!

- type of the stored value.

Return
Try<R>: instance of Failure.