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.
@FunctionalInterface public interface IOSupplier<T>
Represents a supplier of results.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods 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 theafterfunction to the result.default @NonNull Supplier<T>asUnchecked()static <T> @NonNull IOSupplier<T>checked(@NonNull Supplier<T> o)TgetWithIO()Gets a result.static <T> @NonNull IOSupplier<T>of(@Nullable T t)static <T> @NonNull Supplier<T>unchecked(@NonNull IOSupplier<T> o)
-
-
-
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 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
-
unchecked
static <T> @NonNull Supplier<T> unchecked(@NonNull IOSupplier<T> o)
-
checked
static <T> @NonNull IOSupplier<T> checked(@NonNull Supplier<T> o)
-
of
static <T> @NonNull IOSupplier<T> of(@Nullable T t)
-
-