Interface CheckedFunction<T,R>

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

@NullMarked @FunctionalInterface public interface CheckedFunction<T,R>
A functional interface representing a function that accepts one argument, produces a result, and may throw a checked exception. This is a variation of the standard Function interface, intended for use in scenarios where the operation may involve checked exceptions.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(T t)
    Applies this function to the given argument, potentially throwing a checked exception.
  • Method Details

    • apply

      R apply(T t) throws Exception
      Applies this function to the given argument, potentially throwing a checked exception.
      Parameters:
      t - the function argument
      Returns:
      the function result
      Throws:
      Exception - if an error occurs during the application