Package nbbrd.io.function
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.
Represents a supplier of results.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <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 theafterfunction to the result.static <T> @NonNull IOSupplier<T> 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
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 theafterfunction 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 theafterfunction, 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
afterfunction - Throws:
NullPointerException- if after is null
-
asUnchecked
-
unchecked
-
checked
-
of
-