Package com.tnsai.resilience
Interface FallbackStrategy<T>
- Type Parameters:
T- Result type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional contract for providing fallback values when an operation ultimately fails.
-
Method Summary
-
Method Details
-
fallback
Produces a fallback value for the given exception.- Parameters:
exception- The exception that triggered the fallback- Returns:
- Fallback value
-
supports
Indicates whether this fallback can handle the provided exception. Default implementation accepts all exceptions.- Parameters:
exception- Failure cause- Returns:
- true if fallback should run
-