Interface FallibleToIntFunction<T,X extends Throwable>

Type Parameters:
T - The type of the input variable
X - The type of the exception potentially being thrown
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 FallibleToIntFunction<T,X extends Throwable>
An alternative to the ToIntFunction interface that allows the functional method to throw a checked exception.
Author:
Ayco Holleman
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    apply(T arg)
    Calculates a value for the provided argument.
  • Method Details

    • apply

      int apply(T arg) throws X
      Calculates a value for the provided argument.
      Parameters:
      arg - the input variable
      Returns:
      an int value
      Throws:
      X - the exception potentially being thrown