Class 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:
    • Constructor Detail

      • CacheOperations

        public CacheOperations()
    • Method Detail

      • get

        public V get​(K key)
      • isRemoved

        public boolean isRemoved​(K key)
      • cache

        public void cache​(K key,
                          V value)
      • put

        public void put​(K key,
                        V value)
      • putIfAbsent

        public void putIfAbsent​(K key,
                                V value)
        since 7.5 No longer used
      • get

        public 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.
      • remove

        public void remove​(K key)
      • removeAll

        public void removeAll​(Collection<K> keys)
      • clear

        public void clear()
        Clear all recorded cache cachedOperations
      • filter

        public 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.
      • perform

        public void perform​(com.atlassian.cache.Cache<K,​V> cache)
        Perform all recorded cachedOperations on the provided cache
        cache - Cache to perform cachedOperations on
      • operationCount

        public int operationCount()
        The total number of recorded cachedOperations
      • putIfAbsentCount

        public int putIfAbsentCount()
        The number of recorded put cachedOperations
      • putCount

        public int putCount()
        The number of recorded put cachedOperations
      • removeCount

        public int removeCount()
        The number of recorded remove cachedOperations
      • valueCount

        public int valueCount()
        The number of recorded reads