Package org.jdbi.v3.core.internal
Class MemoizingSupplier<T>
java.lang.Object
org.jdbi.v3.core.internal.MemoizingSupplier<T>
- Type Parameters:
T- The type of the object returned by this supplier.
- All Implemented Interfaces:
Supplier<T>
Wraps a supplier and memoizes the object returned.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()voidifInitialized(Consumer<T> consumer) Execute a method on the object returned from the supplier if the object was already created.private Tinit()private Tstatic <T> MemoizingSupplier<T>
-
Field Details
-
create
-
delegate
-
initialized
private volatile boolean initialized -
value
-
-
Constructor Details
-
MemoizingSupplier
-
-
Method Details
-
of
-
get
-
internalGet
-
ifInitialized
Execute a method on the object returned from the supplier if the object was already created. Skips execution if the underlying object was never created.- Parameters:
consumer- A consumer for the object returned by this supplier.
-
init
-