Package com.pivovarit.function
Interface ThrowingIntFunction<R,E extends java.lang.Exception>
-
- Type Parameters:
R- the type of the result of the functionE- the type of the thrown checked exception
- 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 ThrowingIntFunction<R,E extends java.lang.Exception>Functional interface mirroringIntFunctionfor primitive ints from the java.util.function package. This allows wrapping a exceptions in a runtime exception:WrappedExceptionAs this adheres to the
IntFunctioninterface, compose and andThen (as you might be familiar with fromFunctionare not available.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Rapply(int i)default java.util.function.IntFunction<java.util.Optional<R>>lift()static <R> java.util.function.IntFunction<java.util.Optional<R>>lifted(ThrowingIntFunction<R,?> f)static <R> java.util.function.IntFunction<R>sneaky(ThrowingIntFunction<? extends R,?> function)default java.util.function.IntFunction<R>uncheck()static <R> java.util.function.IntFunction<R>unchecked(ThrowingIntFunction<R,?> f)
-
-
-
Method Detail
-
uncheck
default java.util.function.IntFunction<R> uncheck()
-
unchecked
static <R> java.util.function.IntFunction<R> unchecked(ThrowingIntFunction<R,?> f)
-
lifted
static <R> java.util.function.IntFunction<java.util.Optional<R>> lifted(ThrowingIntFunction<R,?> f)
- Returns:
- a Function that returns the result of the given function as an Optional instance. In case of a failure, empty Optional is returned
-
sneaky
static <R> java.util.function.IntFunction<R> sneaky(ThrowingIntFunction<? extends R,?> function)
-
lift
default java.util.function.IntFunction<java.util.Optional<R>> lift()
-
-