Interface IThrowingSupplier<T>

    • Method Detail

      • of

        static <T> IThrowingSupplier<T> of​(IThrowingSupplier<T> supplier)
        Returns the given supplier, 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 supplier = IThrowingSupplier.of(t -> ...);
        
         
        Type Parameters:
        T - the type of results supplied by this supplier
        Parameters:
        supplier - Supplier to return.
        Returns:
        The given supplier.