public class Memoizer<T> extends Object
MoreSuppliers.MemoizingSupplier
. See WeakMemoizer
for a weak reference version of this
class.Constructor and Description |
---|
Memoizer() |
Modifier and Type | Method and Description |
---|---|
T |
get(java.util.function.Supplier<T> delegate) |
T |
get(ThrowingSupplier<T,E> delegate,
Class<E> exceptionClass)
Get the value and memoize the result.
|
public T get(java.util.function.Supplier<T> delegate)
public T get(ThrowingSupplier<T,E> delegate, Class<E> exceptionClass) throws E extends Exception
delegate
- delegate for constructing the valueE extends Exception