Interface ExceptionFunction<T,R,E extends Exception>

Type Parameters:
T - the argument type
R - the result type
E - the exception type
All Known Subinterfaces:
ExceptionUnaryOperator<T,E>
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 ExceptionFunction<T,R,E extends Exception>
A one-argument function which can throw an exception.
  • Method Details

    • apply

      R apply(T t) throws E
      Applies this function to the given arguments.
      Parameters:
      t - the argument
      Returns:
      the function result
      Throws:
      E - if an exception occurs
    • andThen

      default <R2> ExceptionFunction<T,R2,E> andThen(ExceptionFunction<? super R,? extends R2,? extends E> after)
      Returns a function which applies the result of this function to the given function.
      Type Parameters:
      R2 - the final result type
      Parameters:
      after - the next function (must not be null)
      Returns:
      a function which applies the result of this function to the given function
    • andThen

      default <R2> ExceptionFunction<T,R2,E> andThen(ExceptionBiFunction<? super T,? super R,? extends R2,? extends E> after)
      Returns a function which applies the argument to, and result of, this function to the given function.
      Type Parameters:
      R2 - the final result type
      Parameters:
      after - the next function (must not be null)
      Returns:
      a function which applies the argument to, and result of, this function to the given function
    • compose

      default <T2> ExceptionFunction<T2,R,E> compose(ExceptionFunction<? super T2,? extends T,? extends E> before)
      Returns a function which applies the result of the given function to this function.
      Type Parameters:
      T2 - the intermediate argument type
      Parameters:
      before - the first function (must not be null)
      Returns:
      a function which applies the result of the given function to this function
    • andThen

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

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

      default ExceptionPredicate<T,E> andThen(ExceptionPredicate<? super R,? extends E> after)
      Returns a predicate that is true when the given predicate is true for arguments passed through this function.
      Parameters:
      after - the predicate (must not be null)
      Returns:
      a predicate that is true when the given predicate is true for arguments passed through this function
    • andThen

      default ExceptionPredicate<T,E> andThen(ExceptionBiPredicate<? super T,? super R,? extends E> after)
      Returns a predicate that is true when the given predicate is true for arguments passed through this function.
      Parameters:
      after - the predicate (must not be null)
      Returns:
      a predicate that is true when the given predicate is true for arguments passed through this function
    • compose

      default ExceptionSupplier<R,E> compose(ExceptionSupplier<? extends T,? extends E> before)
      Returns a supplier which returns the result of this function when applied to the given supplier.
      Parameters:
      before - the supplier (must not be null)
      Returns:
      a supplier which returns the result of this function when applied to the given supplier