Package sonia.scm.cache
Interface Cache<K,V> 
- Type Parameters:
- K- type of the keys for the cache
- V- type of cached elements
- All Superinterfaces:
- org.apache.shiro.cache.Cache<K,- V> 
public interface Cache<K,V> 
extends org.apache.shiro.cache.Cache<K,V> 
The main interface for the cache.
 Provides methods to add, access, and remove entries from a cache.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()Remove all elements from this cache.booleanReturns true if this cache contains an element with the specified key.Returns the element with the specified key.Returns performance statistics of the cache or null if the cache does not support statistics.Put a new element to this cache.Remove the element with the specified key from this cache.Remove all elements with matchingPredicatefrom this cache.intsize()Returns the number of entries in the cache.Methods inherited from interface org.apache.shiro.cache.Cachekeys, values
- 
Method Details- 
clearvoid clear()Remove all elements from this cache.
- 
containsReturns true if this cache contains an element with the specified key.- Parameters:
- key- key of the cached element
 
- 
putPut a new element to this cache.
- 
removeRemove the element with the specified key from this cache. Return previous cached value.
- 
removeAllRemove all elements with matchingPredicatefrom this cache. The method returns all previous cached values.- Parameters:
- predicate- predicate to match cache keys
- Since:
- 1.9
 
- 
sizeint size()Returns the number of entries in the cache.
- 
getReturns the element with the specified key. Returns null if the cache contains no element with the specified key.
- 
getStatisticsCacheStatistics getStatistics()Returns performance statistics of the cache or null if the cache does not support statistics. The returned statistic is a snapshot of the current performance.- Since:
- 2.0.0
 
 
-