Interface StoreSupplier<T>
- Type Parameters:
T- type supplied to the store
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Supplier of an object for a store.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> StoreSupplier<T> cache(StoreSupplier<T> supplier) Memoizes (caches) the supplied object, and returning it with an identical interface.static <T> CachedSupplier<T, OperationFailedException> cacheResettable(StoreSupplier<T> supplier) Memoizes (caches) the supplied object, and returning it with aCachedSupplierinterfaceget()Gets the object being supplied to the store.
-
Method Details
-
get
Gets the object being supplied to the store.- Returns:
- the supplied object
- Throws:
OperationFailedException- if anything goes wrong
-
cache
Memoizes (caches) the supplied object, and returning it with an identical interface.- Type Parameters:
T- type to supply- Parameters:
supplier- supplier to cache- Returns:
- a
StoreSupplierinterface that memoizes the supplied object
-
cacheResettable
Memoizes (caches) the supplied object, and returning it with aCachedSupplierinterfaceThis interface can be used to reset and do other operations o the cache.
- Type Parameters:
T- type to supply- Parameters:
supplier- supplier to cache- Returns:
- a
StoreSupplierinterface that memoizes the supplied object
-