Interface ExceptionSupplier<T,E extends Exception>

Type Parameters:
T - the result type
E - the exception type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ExceptionSupplier<T,E extends Exception>
A supplier which can throw an exception.
  • Method Summary

    Modifier and Type
    Method
    Description
    andThen(ExceptionConsumer<? super T,? extends E> after)
    Returns a runnable which passes the result of this supplier to the given consumer.
    default <R> ExceptionSupplier<R,E>
    andThen(ExceptionFunction<? super T,? extends R,? extends E> after)
    Returns a supplier which passes the result of this supplier through the given function.
    get()
    Gets a result.
  • Method Details

    • get

      T get() throws E
      Gets a result.
      Returns:
      the result
      Throws:
      E - if an exception occurs
    • andThen

      default ExceptionRunnable<E> andThen(ExceptionConsumer<? super T,? extends E> after)
      Returns a runnable which passes the result of this supplier to the given consumer.
      Parameters:
      after - the consumer (must not be null)
      Returns:
      a runnable which passes the result of this supplier to the given consumer
    • andThen

      default <R> ExceptionSupplier<R,E> andThen(ExceptionFunction<? super T,? extends R,? extends E> after)
      Returns a supplier which passes the result of this supplier through the given function.
      Type Parameters:
      R - the result type
      Parameters:
      after - the function (must not be null)
      Returns:
      a supplier which passes the result of this supplier through the given function