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.

@FunctionalInterface public interface StoreSupplier<T>
Supplier of an object for a store.
Author:
Owen Feehan
  • Method Details

    • get

      Gets the object being supplied to the store.
      Returns:
      the supplied object
      Throws:
      OperationFailedException - if anything goes wrong
    • cache

      static <T> StoreSupplier<T> cache(StoreSupplier<T> supplier)
      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 StoreSupplier interface that memoizes the supplied object
    • cacheResettable

      static <T> CachedSupplier<T,OperationFailedException> cacheResettable(StoreSupplier<T> supplier)
      Memoizes (caches) the supplied object, and returning it with a CachedSupplier interface

      This 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 StoreSupplier interface that memoizes the supplied object