java.lang.Object
io.helidon.faulttolerance.Fallback.Builder<T>
- Type Parameters:
T
- type of the values returned
- All Implemented Interfaces:
Builder<Fallback.Builder<T>,
,Fallback<T>> Supplier<Fallback<T>>
public static class Fallback.Builder<T>
extends Object
implements Builder<Fallback.Builder<T>,Fallback<T>>
Fluent API builder for
Fallback
.-
Method Summary
Modifier and TypeMethodDescriptionaddApplyOn
(Class<? extends Throwable> clazz) Apply fallback on this throwable class.Do not apply fallback on this throwable class.final Fallback.Builder<T>
Apply fallback on these throwable classes.build()
Build the instance from this builder.fallback
(Function<Throwable, ? extends CompletionStage<T>> fallback) Configure a fallback for aSingle
orCompletionStage
.fallbackMulti
(Function<Throwable, ? extends Flow.Publisher<T>> fallback) Configure a fallback for aMulti
orFlow.Publisher
.final Fallback.Builder<T>
Do not apply fallback on these throwable classes.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder. -
fallback
Configure a fallback for aSingle
orCompletionStage
.- Parameters:
fallback
- fallback supplier to obtain the alternative result- Returns:
- updated builder instance
-
fallbackMulti
Configure a fallback for aMulti
orFlow.Publisher
.- Parameters:
fallback
- fallback supplier to obtain the alternative result- Returns:
- updated builder instance
-
applyOn
Apply fallback on these throwable classes. Cannot be combined withskipOn(Class[])
.- Parameters:
classes
- classes to fallback on- Returns:
- updated builder instance
-
addApplyOn
Apply fallback on this throwable class.- Parameters:
clazz
- class to fallback on- Returns:
- updated builder instance
-
skipOn
Do not apply fallback on these throwable classes. Cannot be combined withapplyOn(Class[])
.- Parameters:
classes
- classes not to fallback on- Returns:
- updated builder instance
-
addSkipOn
Do not apply fallback on this throwable class.- Parameters:
clazz
- class not to fallback on- Returns:
- updated builder instance
-