T - input parameter typeR - result type@FunctionalInterface public interface ThrowingFunction<T,R>
Function, that declares a checked exception.
This helps with handling checked exceptions in lambdas.| Modifier and Type | Method and Description |
|---|---|
R |
apply(T input)
Check
Function.apply(Object) |
static <T,R> Function<T,R> |
unchecked(ThrowingFunction<T,R> lambda)
Wraps a lambda by handling checked Exception - converting it into
RuntimeException |
static <T,R> Function<T,R> |
unchecked(ThrowingFunction<T,R> lambda,
Function<Exception,? extends RuntimeException> exceptionMapper)
Wraps a lambda by handling checked Exception.
|
R apply(T input) throws Exception
Function.apply(Object)input - function input parameter of type TException - a checked exception might be thrownstatic <T,R> Function<T,R> unchecked(ThrowingFunction<T,R> lambda)
RuntimeExceptionT - lambda input typeR - lambda result typelambda - lambda functionstatic <T,R> Function<T,R> unchecked(ThrowingFunction<T,R> lambda, Function<Exception,? extends RuntimeException> exceptionMapper)
RuntimeExceptionT - lambda input typeR - lambda result typelambda - lambda functionexceptionMapper - mapper, transforming checked exception into runtimeCopyright © 2024 Atlassian. All rights reserved.