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 Summary

    Modifier and Type
    Method
    Description
    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.
    default @NonNull Supplier<T>
     
    static <T> @NonNull IOSupplier<T>
    checked(@NonNull Supplier<T> o)
     
    Gets a result.
    static <T> @NonNull IOSupplier<T>
    of(@Nullable T t)
     
    static <T> @NonNull Supplier<T>
    unchecked(@NonNull IOSupplier<T> o)
     
  • Method Details

    • getWithIO

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

      @NonNull default <V> @NonNull IOSupplier<V> andThen(@NonNull @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

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

      @NonNull static <T> @NonNull Supplier<T> unchecked(@NonNull @NonNull IOSupplier<T> o)
    • checked

      @NonNull static <T> @NonNull IOSupplier<T> checked(@NonNull @NonNull Supplier<T> o)
    • of

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