Interface Fallback<T>

Type Parameters:
T - type of the values returned
All Superinterfaces:
FtHandlerTyped<T>

public interface Fallback<T> extends FtHandlerTyped<T>
Fallback allows the user to execute an alternative function in case the provided supplier fails.
  • Method Details

    • builder

      static <T> Fallback.Builder<T> builder()
      A builder to customize Fallback.
      Type Parameters:
      T - type of the values returned by the failing method
      Returns:
      a new builder
    • create

      static <T> Fallback<T> create(Function<Throwable,? extends T> fallback)
      Create a fallback for a callable.
      Type Parameters:
      T - type of the result
      Parameters:
      fallback - fallback supplier to obtain the alternative result
      Returns:
      a new fallback