Package com.atlassian.confluence.cache
Class CacheOperations<K,V>
- java.lang.Object
- 
- com.atlassian.confluence.cache.CacheOperations<K,V>
 
- 
 @Internal public class CacheOperations<K,V> extends Object A cache operation recorder. Offers the ability to record a series of cache modification operations and perform them on a target cache at a later time.- See Also:
- DeferredOperationsCache
 
- 
- 
Constructor SummaryConstructors Constructor Description CacheOperations()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcache(K key, V value)voidclear()Clear all recorded cache cachedOperationsSet<K>filter(Iterable<K> globalKeys)Filters the supplied list of keys by adding those from any 'put' operations and removing those from any 'remove' operations.Vget(K key)@NonNull Vget(K key, com.atlassian.cache.Supplier<? extends V> supplier)Return the value for the given key, or load a new value into the session cache using the given supplier.booleanisRemoved(K key)intoperationCount()voidperform(com.atlassian.cache.Cache<K,V> cache)Perform all recorded cachedOperations on the provided cachevoidput(K key, V value)intputCount()voidputIfAbsent(K key, V value)Deprecated.since 7.5 No longer usedintputIfAbsentCount()voidremove(K key)voidremoveAll(Collection<K> keys)intremoveCount()intvalueCount()
 
- 
- 
- 
Method Detail- 
isRemovedpublic boolean isRemoved(K key) 
 - 
putIfAbsent@Deprecated public void putIfAbsent(K key, V value) Deprecated.since 7.5 No longer used
 - 
getpublic @NonNull V get(K key, com.atlassian.cache.Supplier<? extends V> supplier) Return the value for the given key, or load a new value into the session cache using the given supplier. When the deferred operations are performed, this will call get-with-supplier on the delegate cache, with the previously loaded value being supplied.- Since:
- 7.5
 
 - 
removepublic void remove(K key) 
 - 
removeAllpublic void removeAll(Collection<K> keys) 
 - 
clearpublic void clear() Clear all recorded cache cachedOperations
 - 
filterpublic Set<K> filter(Iterable<K> globalKeys) Filters the supplied list of keys by adding those from any 'put' operations and removing those from any 'remove' operations.
 - 
performpublic void perform(com.atlassian.cache.Cache<K,V> cache) Perform all recorded cachedOperations on the provided cache- Parameters:
- cache- Cache to perform cachedOperations on
 
 - 
operationCountpublic int operationCount() - Returns:
- The total number of recorded cachedOperations
 
 - 
putIfAbsentCountpublic int putIfAbsentCount() - Returns:
- The number of recorded put cachedOperations
 
 - 
putCountpublic int putCount() - Returns:
- The number of recorded put cachedOperations
 
 - 
removeCountpublic int removeCount() - Returns:
- The number of recorded remove cachedOperations
 
 - 
valueCountpublic int valueCount() - Returns:
- The number of recorded reads
 
 
- 
 
-