Kactoos

kactoos-jvm / nnl.rocks.kactoos.scalar / FallbackFrom

FallbackFrom

class FallbackFrom<T : Any> : Func<Throwable, T>

Fallback from exception.

There is no thread-safety guarantee.

Parameters

T - Type of result

exceptions - The list of exceptions supported by this instance.

func - Function that converts exceptions to the required type.

Since 0.4

Constructors

Name Summary
<init> FallbackFrom(exp: Class<out Throwable>, func: KFunc<Throwable, T>)FallbackFrom(exceptions: Iterable<Class<out Throwable>>, func: KFunc<Throwable, T>)
Fallback from exception.

Functions

Name Summary
apply fun apply(input: Throwable): T
Apply it.
support fun support(target: Class<out Throwable>): Int
Calculate level of support of the given exception type.