diff --git a/pandalib-util/src/main/java/fr/pandacube/lib/util/function/FunctionException.java b/pandalib-util/src/main/java/fr/pandacube/lib/util/function/FunctionException.java new file mode 100644 index 0000000..aed9402 --- /dev/null +++ b/pandalib-util/src/main/java/fr/pandacube/lib/util/function/FunctionException.java @@ -0,0 +1,19 @@ +package fr.pandacube.lib.util.function; + +/** + * A function that can possibly throw a checked exception. + * @param the parameter for this function. + * @param the return value for this function. + * @param the exception type that this interface method can throw. + */ +@FunctionalInterface +public interface FunctionException { + /** + * Run on the specified parameters to return an int value. + * + * @param t the parameter of the function. + * @return the result of the function. + * @throws E if the function fails. + */ + R apply(T t) throws E; +}