T - type of supplied value@NotThreadSafe
public static class StreamUtils.LazySupplier<T>
extends java.lang.Object
implements java.util.function.Supplier<T>
Example:
LazySupplier<InputStream> supplier = LazySupplier.of(() -> {
return new FileInputStream(file);
});
...
if (supplier.supplied()) {
IOUtils.closeQuietly(inputStreamSupplier.get());
}
| Constructor and Description |
|---|
LazySupplier(java.util.function.Supplier<T> supplier) |
| Modifier and Type | Method and Description |
|---|---|
T |
get() |
static <T> StreamUtils.LazySupplier<T> |
of(java.util.function.Supplier<T> supplier) |
boolean |
supplied() |
public LazySupplier(java.util.function.Supplier<T> supplier)
public static <T> StreamUtils.LazySupplier<T> of(java.util.function.Supplier<T> supplier)
public boolean supplied()
get() invocation