Interface ThrowingFunction<T,​R>

Type Parameters:
T - the type of the input to the function.
R - the type of the result of 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> extends Function<T,​R>
Represents a function that accepts one argument and produces a result. This is the throwing specialization of Function.

This is a functional interface whose functional method is apply(Object).

  • Method Summary

    Modifier and Type
    Method
    Description
    default R
    apply​(T t)
     
    applyThrows​(T t)
    Performs this operation on the given arguments.

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Method Details

    • applyThrows

      R applyThrows(T t) throws RuntimeException
      Performs this operation on the given arguments.
      Parameters:
      t - the function argument.
      Returns:
      the function result.
      Throws:
      RuntimeException - Thrown if any exception happens during lambda execution.
    • apply

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