Interface ThrowingFunction<T,R,X extends Throwable>

Type Parameters:
T - the type of the input to the function
R - the type of the result of the function
X - the type of the exception thrown by the function
All Superinterfaces:
Function<T,R>
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 ThrowingFunction<T,R,X extends Throwable> extends Function<T,R>
An extension of Function allowing throwing calls in its body.
  • Method Summary

    Modifier and Type
    Method
    Description
    default R
    apply(T t)
     
    Applies this function to the given argument.
    default R
    invoke(T t)
    Deprecated.

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Method Details

    • applyChecked

      R applyChecked(T t) throws X
      Applies this function to the given argument.
      Parameters:
      t - the function argument
      Returns:
      the function result
      Throws:
      X - if an exception happens
    • invoke

      @Deprecated default R invoke(T t) throws X
      Deprecated.
      Applies this function to the given argument.
      Parameters:
      t - the function argument
      Returns:
      the function result
      Throws:
      X - if an exception happens
    • apply

      default R apply(T t)
      Specified by:
      apply in interface Function<T,R>