Interface ISerializableThrowingFunction<T,​R>

    • Method Detail

      • of

        static <T,​R> ISerializableThrowingFunction<T,​R> of​(ISerializableThrowingFunction<T,​R> fn)
        Returns the given function, for improved variable inference. Sometimes you need to create local variables and assign them to a new lambda. This does not work well with variable inference, as Java cannot infer the type of an anonymous lambda. This utility method lets you write slightly more readable code like this:
         final var fn = ISerializableThrowingFunction.of(t -> ...);
        
         
        Type Parameters:
        T - the type of results supplied by this supplier
        R - the type of the result of the function
        Parameters:
        fn - Function to return.
        Returns:
        The given function.