All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pkl.thirdparty.paguro.function.package.html Maven / Gradle / Ivy

Go to download

Shaded fat Jar for pkl-config-java, a Java config library based on the Pkl config language.

There is a newer version: 0.27.1
Show newest version


Exception-friendly functional interfaces named by the number of arguments: Fn0, Fn1, Fn2.... All of these have an applyEx() method that that throws an Exception and returns a result. Implementers should override the applyEx() method (this happens automatically when you use Java 8's lambda syntax). Each interface also has a default apply() method for consumers of this function to call. It re-throws all exceptions after wrapping any checked ones in unchecked RuntimeExceptions.

For simplicity, there are no primitive versions of these functions, no "void" return types, and no special-purpose funny names. If you don't want to return a result, declare the return type as ? and return null. Comparing just the Consumer interfaces from { @link java.util.function}:

java.util.functionorg.organicdesign.fp.function
Consumer<T>Fn1<T,?>
DoubleConsumerFn1<Double,?>
IntConsumerFn1<Integer,?>
LongConsumerFn1<Long,?>
BiConsumer<T,U>Fn2<T,U,?>
ObjDoubleConsumer<T>Fn2<T,Double,?>
ObjIntConsumer<T>Fn2<T,Integer,?>
ObjLongConsumer<T>Fn2<T,Long,?>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy