- java.lang.Object
-
- io.helidon.faulttolerance.Fallback.Builder<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Fallback.Builder<T>addApplyOn(Class<? extends Throwable> clazz)Apply fallback on this throwable class.Fallback.Builder<T>addSkipOn(Class<? extends Throwable> clazz)Do not apply fallback on this throwable class.Fallback.Builder<T>applyOn(Class<? extends Throwable>... classes)Apply fallback on these throwable classes.Fallback<T>build()Build the instance from this builder.Fallback.Builder<T>fallback(Function<Throwable,? extends CompletionStage<T>> fallback)Configure a fallback for aSingleorCompletionStage.Fallback.Builder<T>fallbackMulti(Function<Throwable,? extends Flow.Publisher<T>> fallback)Configure a fallback for aMultiorFlow.Publisher.Fallback.Builder<T>skipOn(Class<? extends Throwable>... classes)Do not apply fallback on these throwable classes.
-
-
-
Method Detail
-
build
public Fallback<T> build()
Description copied from interface:BuilderBuild the instance from this builder.
-
fallback
public Fallback.Builder<T> fallback(Function<Throwable,? extends CompletionStage<T>> fallback)
Configure a fallback for aSingleorCompletionStage.- Parameters:
fallback- fallback supplier to obtain the alternative result- Returns:
- updated builder instance
-
fallbackMulti
public Fallback.Builder<T> fallbackMulti(Function<Throwable,? extends Flow.Publisher<T>> fallback)
Configure a fallback for aMultiorFlow.Publisher.- Parameters:
fallback- fallback supplier to obtain the alternative result- Returns:
- updated builder instance
-
applyOn
@SafeVarargs public final Fallback.Builder<T> applyOn(Class<? extends Throwable>... classes)
Apply fallback on these throwable classes. Cannot be combined withskipOn(Class[]).- Parameters:
classes- classes to fallback on- Returns:
- updated builder instance
-
addApplyOn
public Fallback.Builder<T> addApplyOn(Class<? extends Throwable> clazz)
Apply fallback on this throwable class.- Parameters:
clazz- class to fallback on- Returns:
- updated builder instance
-
skipOn
@SafeVarargs public final Fallback.Builder<T> skipOn(Class<? extends Throwable>... classes)
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
public Fallback.Builder<T> addSkipOn(Class<? extends Throwable> clazz)
Do not apply fallback on this throwable class.- Parameters:
clazz- class not to fallback on- Returns:
- updated builder instance
-
-