Class DefaultSingleItemChainable

java.lang.Object
com.broadleafcommerce.common.extension.cache.api.DefaultSingleItemChainable
All Implemented Interfaces:
SingleItemCacheable, SingleItemChainable

public class DefaultSingleItemChainable extends Object implements SingleItemChainable, SingleItemCacheable
Default transition object for holding state during method chaining from CacheUtility.forSingleWith(CacheStateManager).
Author:
Jeff Fischer
  • Constructor Details

    • DefaultSingleItemChainable

      public DefaultSingleItemChainable()
  • Method Details

    • with

      public SingleItemChainable with(CacheStateManager cacheStateManager)
    • andCacheInfo

      public SingleItemCacheable andCacheInfo(String cacheName, ContextKeyGen generator, Object[] args)
      Specified by:
      andCacheInfo in interface SingleItemChainable
    • andEntityInfo

      public SingleItemCacheable andEntityInfo(Supplier<EntityInfo> factoryFunction)
      Description copied from interface: SingleItemCacheable
      Optional. Provide additional, identifying information about the cache member via the factory function. This information is used to influence the cache key, allowing the identifying information to be discerned by other processes (e.g. discrete cache invalidation).
      Specified by:
      andEntityInfo in interface SingleItemCacheable
      Parameters:
      factoryFunction - Used to construct additional, identifying information about the cache member
      Returns:
      The chained element
    • andEntityInfo

      public SingleItemCacheable andEntityInfo(Function<Stream<?>,List<EntityInfo>> infoFunction)
      Description copied from interface: SingleItemCacheable
      Optional. Provide additional, identifying information about the cache member via the factory function. This information is used to influence the cache key, allowing the identifying information to be discerned by other processes (e.g. discrete cache invalidation). The input to the function is the result of SingleItemCacheable.computeIfAbsent(Supplier). If the input happens to be streamable, this it's stream is used. Otherwise, a single item list of the specific result of computeIfAbsent is streamed. The output of the function is the one or more info DTO instances targeting entities whose update will target invalidation of this cache.
      Specified by:
      andEntityInfo in interface SingleItemCacheable
      Parameters:
      infoFunction - Used to construct additional, identifying information about the cache member(s).
      Returns:
      The chained element
    • computeIfAbsent

      public <P> P computeIfAbsent(Supplier<P> compute)
      Specified by:
      computeIfAbsent in interface SingleItemCacheable
    • getCacheStateManager

      public CacheStateManager getCacheStateManager()
    • getCacheInfo

      public CacheInfo getCacheInfo()
    • getSingleItemFunction

      public Supplier<?> getSingleItemFunction()
    • setCacheStateManager

      public void setCacheStateManager(CacheStateManager cacheStateManager)
    • setCacheInfo

      public void setCacheInfo(CacheInfo cacheInfo)
    • setSingleItemFunction

      public void setSingleItemFunction(Supplier<?> singleItemFunction)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object