Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaFunctions

        public JavaFunctions()
    • 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 a null input or the result of function for a non-null input