Package io.github.jonestimd.util
Class JavaFunctions
- java.lang.Object
-
- io.github.jonestimd.util.JavaFunctions
-
public class JavaFunctions extends java.lang.Object
Utility methods for functional interfaces.
-
-
Constructor Summary
Constructors Constructor Description JavaFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,R>
java.util.function.Function<T,R>nullGuard(java.util.function.Function<T,R> function)
Add a null check to a function.
-
-
-
Method Detail
-
nullGuard
public static <T,R> java.util.function.Function<T,R> nullGuard(java.util.function.Function<T,R> function)
Add a null check to a function.- Parameters:
function
- the function to guard against null input- Returns:
- a function that returns
null
for anull
input or the result offunction
for a non-null
input
-
-