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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionandCacheInfo(String cacheName, ContextKeyGen generator, Object[] args) andEntityInfo(Function<Stream<?>, List<EntityInfo>> infoFunction) Optional.andEntityInfo(Supplier<EntityInfo> factoryFunction) Optional.protected boolean<P> PcomputeIfAbsent(Supplier<P> compute) booleanSupplier<?>inthashCode()voidsetCacheInfo(CacheInfo cacheInfo) voidsetCacheStateManager(CacheStateManager cacheStateManager) voidsetSingleItemFunction(Supplier<?> singleItemFunction) toString()with(CacheStateManager cacheStateManager)
-
Constructor Details
-
DefaultSingleItemChainable
public DefaultSingleItemChainable()
-
-
Method Details
-
with
-
andCacheInfo
- Specified by:
andCacheInfoin interfaceSingleItemChainable
-
andEntityInfo
Description copied from interface:SingleItemCacheableOptional. 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:
andEntityInfoin interfaceSingleItemCacheable- Parameters:
factoryFunction- Used to construct additional, identifying information about the cache member- Returns:
- The chained element
-
andEntityInfo
Description copied from interface:SingleItemCacheableOptional. 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 ofSingleItemCacheable.computeIfAbsent(Supplier). If the input happens to be streamable, this it's stream is used. Otherwise, a single item list of the specific result ofcomputeIfAbsentis 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:
andEntityInfoin interfaceSingleItemCacheable- Parameters:
infoFunction- Used to construct additional, identifying information about the cache member(s).- Returns:
- The chained element
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceSingleItemCacheable
-
getCacheStateManager
-
getCacheInfo
-
getSingleItemFunction
-
setCacheStateManager
-
setCacheInfo
-
setSingleItemFunction
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-