Fallback.From<T>, Fallback.None<X>
Constructor and Description |
---|
From(Class<? extends Throwable> exp,
Func<Throwable,T> func)
Ctor.
|
From(Iterable<Class<? extends Throwable>> exps,
Func<Throwable,T> func)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
T |
apply(Throwable exp)
Apply it.
|
int |
support(Throwable exception)
Calculate level of support of the given exception type.
|
public From(Class<? extends Throwable> exp, Func<Throwable,T> func)
exp
- Supported exception typefunc
- Function that converts the given exception into required onepublic T apply(Throwable exp) throws Exception
Func
public int support(Throwable exception)
Fallback
support
in interface Fallback<T>
exception
- ExceptionInteger.MIN_VALUE
otherwiseCopyright © 2017–2022 Cactoos. All rights reserved.