Interface IOSupplier<T>

  • Type Parameters:
    T - the type of results supplied by this supplier
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface IOSupplier<T>
    Represents a supplier of results.
    • Method Detail

      • getWithIO

        @JdkWithIO
        T getWithIO()
             throws IOException
        Gets a result.
        Returns:
        a result
        Throws:
        IOException - if an I/O error occurs
      • andThen

        default <V> @NonNull IOSupplier<V> andThen​(@NonNull IOFunction<? super T,​? extends V> after)
        Returns a composed supplier that first gets a value from this function, and then applies the after function to the result. If evaluation throws an exception, it is relayed to the caller of the composed function.
        Type Parameters:
        V - the type of output of the after function, and of the composed supplier
        Parameters:
        after - the function to apply after this function is applied
        Returns:
        a composed supplier that first gets a value from this function and then applies the after function
        Throws:
        NullPointerException - if after is null
      • asUnchecked

        default @NonNull Supplier<T> asUnchecked()
      • of

        static <T> @NonNull IOSupplier<T> of​(@Nullable T t)