com.atlassian.confluence.cache
Class CacheAdapter<K,V>

java.lang.Object
  extended by com.atlassian.confluence.cache.CacheAdapter<K,V>
All Implemented Interfaces:
com.atlassian.cache.Cache<K,V>
Direct Known Subclasses:
DeferredOperationsCache

public abstract class CacheAdapter<K,V>
extends java.lang.Object
implements com.atlassian.cache.Cache<K,V>

Delegates to an underlying cache. Subclass this to override just some of the underlying cache's behaviour.


Constructor Summary
CacheAdapter(com.atlassian.cache.Cache<K,V> underlyingCache)
           
 
Method Summary
 boolean containsKey(K k)
           
 V get(K key)
           
protected  com.atlassian.cache.Cache<K,V> getDelegate()
           
 java.util.Collection<K> getKeys()
           
 java.lang.String getName()
           
 void put(K key, V value)
           
 V putIfAbsent(K key, V value)
           
 void remove(K key)
           
 boolean remove(K key, V value)
           
 void removeAll()
           
 boolean replace(K key, V oldValue, V newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheAdapter

public CacheAdapter(com.atlassian.cache.Cache<K,V> underlyingCache)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface com.atlassian.cache.Cache<K,V>

get

public V get(K key)
Specified by:
get in interface com.atlassian.cache.Cache<K,V>

getKeys

public java.util.Collection<K> getKeys()
Specified by:
getKeys in interface com.atlassian.cache.Cache<K,V>

put

public void put(K key,
                V value)
Specified by:
put in interface com.atlassian.cache.Cache<K,V>

remove

public void remove(K key)
Specified by:
remove in interface com.atlassian.cache.Cache<K,V>

removeAll

public void removeAll()
Specified by:
removeAll in interface com.atlassian.cache.Cache<K,V>

putIfAbsent

public V putIfAbsent(K key,
                     V value)
Specified by:
putIfAbsent in interface com.atlassian.cache.Cache<K,V>

replace

public boolean replace(K key,
                       V oldValue,
                       V newValue)
Specified by:
replace in interface com.atlassian.cache.Cache<K,V>

remove

public boolean remove(K key,
                      V value)
Specified by:
remove in interface com.atlassian.cache.Cache<K,V>

containsKey

public boolean containsKey(@NotNull
                           K k)
Specified by:
containsKey in interface com.atlassian.cache.Cache<K,V>

getDelegate

protected com.atlassian.cache.Cache<K,V> getDelegate()


Copyright © 2003-2014 Atlassian. All Rights Reserved.