Package com.atlassian.jira.cache
Class CacheUtils
java.lang.Object
com.atlassian.jira.cache.CacheUtils
-
Method Summary
-
Method Details
-
getBulk
@Nonnull public static <K,V> Map<K,V> getBulk(@Nonnull com.atlassian.cache.Cache<K, V> cache, @Nonnull Set<K> keys, @Nonnull Function<Set<K>, Map<K, V>> valuesSupplier) This method is a slightly changed implementation ofReadThroughCache.getBulk(Set, Function).The original implementation uses
ReadThroughCache.get(Object)in order to check if value is in cache. When cache instance is initiated withCacheLoader, eachReadThroughCache.get(Object)call for absent in cache value causes value to be loaded usingCacheLoader. It makesReadThroughCache.getBulk(Set, Function)useless.The new implementation uses
ReadThroughCache.containsKey(Object)to verify if value is in the cache.- Type Parameters:
K- key typeV- value type- Parameters:
cache- the cache instancekeys- set of keys to loadvaluesSupplier- function that loads values- Returns:
- map with loaded values for keys
-