-
Notifications
You must be signed in to change notification settings - Fork 19
/
Processor.java
36 lines (33 loc) · 1.06 KB
/
Processor.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* Made with all the love in the world
* by scireum in Remshalden, Germany
*
* Copyright by scireum GmbH
* http://www.scireum.de - info@scireum.de
*/
package sirius.kernel.commons;
/**
* Implements the {@link java.util.function.Function} pattern but permits the function to throw an exception.
* <p>
* This sometimes might simplify exception handling. If this feature is not required use a plain
* {@link java.util.function.Function} instead.
*
* @param <T> the type of the input to the function
* @param <R> the type of the result of the function
*
* @see UnitOfWork
* @see Callback
* @see Producer
*/
@FunctionalInterface
public interface Processor<T, R> {
/**
* Applies this function to the given argument.
*
* @param t the function argument
* @return the function result
* @throws Exception the callee may throw any exception during the computation. Therefore the caller should
* implement proper error handling without relying on specific exception types.
*/
R apply(T t) throws Exception;
}