T - The type of results supplied by this supplier.@FunctionalInterface public interface IOSupplier<T>
IOException throwing equivalent of Supplier.| Modifier and Type | Method and Description |
|---|---|
static <T> IOSupplier<T> |
checked(Supplier<? extends T> supplier)
Returns a supplier that returns the result of the
supplier supplier, and unwraps any UncheckedIOException that is thrown by
throwing its cause. |
T |
get()
Gets a result.
|
static <T> Supplier<T> |
unchecked(IOSupplier<? extends T> supplier)
Returns a supplier that returns the result of the
supplier supplier, and wraps any IOException that is thrown in an
UncheckedIOException. |
T get() throws IOException
IOException - If an I/O error occurs.static <T> Supplier<T> unchecked(IOSupplier<? extends T> supplier)
supplier supplier, and wraps any IOException that is thrown in an
UncheckedIOException.T - The type of results supplied by the supplier.supplier - The supplier that will provide results for the returned supplier.supplier supplier, and wraps any IOException that is thrown in an
UncheckedIOException.NullPointerException - If supplier is null.static <T> IOSupplier<T> checked(Supplier<? extends T> supplier)
supplier supplier, and unwraps any UncheckedIOException that is thrown by
throwing its cause.T - The type of results supplied by the supplier.supplier - The supplier that will provide results for the returned supplier.supplier supplier, and unwraps any UncheckedIOException that is thrown.NullPointerException - If supplier is null.Copyright © 2017–2020. All rights reserved.