Package javascalautils
Interface ThrowableFunction1<T,R>
-
- Type Parameters:
T
- The type this function will consumeR
- The type this function will return
- 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 ThrowableFunction1<T,R>
A function that takes a single argument of type R and returns a value of type T.
The difference with this interface andFunction
is that it allows for raising checked exceptions.
Primary use case is to create concise lambda expressions such as theTry.map(ThrowableFunction1)
andFuture.map(ThrowableFunction1)
where the function could throw an exception.- Since:
- 1.10
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description R
apply(T t)
Applies this function returning a result.
-