Package org.cyclos.impl.utils.cache
Interface Cache<K extends Serializable,V extends Serializable>
-
- All Known Implementing Classes:
AbstractCache,GuavaCache
public interface Cache<K extends Serializable,V extends Serializable>Interface for general caches
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Removes all entries in this cachevoiddestroy()Destroys this cache instancevoidevict(Collection<K> keys)Evicts the given keys, if presentvoidevict(Predicate<K> predicate)Evicts the keys matching the given predicateVget(K key, Callable<V> producer)Returns the value currently associated with the given key, or gets one from the given producer if noneCacheType<K,V>getType()Returns this cache type
-
-
-
Method Detail
-
clear
void clear()
Removes all entries in this cache
-
destroy
void destroy()
Destroys this cache instance
-
evict
void evict(Collection<K> keys)
Evicts the given keys, if present
-
get
V get(K key, Callable<V> producer)
Returns the value currently associated with the given key, or gets one from the given producer if none
-
-