Package javascalautils
Interface ThrowableFunction0<T>
-
- Type Parameters:
T
- 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 ThrowableFunction0<T>
A function that takes no arguments 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.apply(ThrowableFunction0)
andFuture.apply(ThrowableFunction0)
- Since:
- 1.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
apply()
Applies this function returning a result.
-
-
-
Method Detail
-
apply
T apply() throws java.lang.Throwable
Applies this function returning a result.- Returns:
- The function result
- Throws:
java.lang.Throwable
- Any error that may occur when applying the function- Since:
- 1.3
-
-