T
- result-typeE
- exception that is thrown if something goes wrongpublic class CachedSupplier<T,E extends Exception> extends CachedSupplierBase<T> implements CheckedSupplier<T,E>
CheckedSupplier
.Modifier and Type | Method and Description |
---|---|
static <T,E extends Exception> |
cache(java.util.function.Supplier<T> suppplier)
Creates a cached-version of a
Supplier . |
static <T,E extends Exception> |
cacheChecked(CheckedSupplier<T,E> suppplier)
Creates a cached-version of a
CheckedSupplier . |
T |
get()
Applies a supplier like with
Supplier.get() . |
call, isEvaluated, reset
public static <T,E extends Exception> CachedSupplier<T,E> cache(java.util.function.Supplier<T> suppplier)
Supplier
.T
- return-typeE
- exception that will never be thrown, but is parameterized to match the
destination-type..suppplier
- supplies the value to be calculated and cached.public static <T,E extends Exception> CachedSupplier<T,E> cacheChecked(CheckedSupplier<T,E> suppplier)
CheckedSupplier
.T
- return-typeE
- exception that may be thrown.suppplier
- supplies the value to be calculated and cached.public T get() throws E extends Exception
CheckedSupplier
Supplier.get()
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.