public class ThreadMemoizingSupplier<T>
extends java.lang.Object
implements java.util.function.Supplier<T>
| Constructor and Description |
|---|
ThreadMemoizingSupplier(java.util.function.Supplier<T> wrapped) |
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Will always fire the wrapped supplier and return the value, which is
then cached on the thread.
|
T |
getCached()
Returns the cached type.
|
java.util.function.Supplier<T> |
getWrapped()
Returns the underlying supplier used to fetch the value.
|
T |
release() |
public ThreadMemoizingSupplier(java.util.function.Supplier<T> wrapped)
public T getCached()
public T release()
public T get()
get in interface java.util.function.Supplier<T>public java.util.function.Supplier<T> getWrapped()