Package org.mycore.common.function
Interface MCRThrowableTask<T extends Throwable>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MCRThrowableTask<T>
andThen
(MCRThrowableTask<? extends T> after) Returns a composed task that first this task, and then runs theafter
task.default MCRThrowableTask<T>
compose
(MCRThrowableTask<? extends T> before) Returns a composed task that first runs thebefore
task, and then runs this task.void
run()
-
Method Details
-
run
-
compose
Returns a composed task that first runs thebefore
task, and then runs this task. If evaluation of either function throws an exception, it is relayed to the caller of the composed function.- Parameters:
before
- the function to apply before this function is applied- Returns:
- a composed function that first applies the
before
function and then applies this function - Throws:
NullPointerException
- if before is null- See Also:
-
andThen
Returns a composed task that first this task, and then runs theafter
task. If evaluation of either function throws an exception, it is relayed to the caller of the composed function.- Parameters:
after
- the function to apply after this function is applied- Returns:
- a composed task that first runs this task and then
the
after
task - Throws:
NullPointerException
- if after is null- See Also:
-