Package org.thymeleaf.cache
Class StandardCache<K,V>
- Object
-
- org.thymeleaf.cache.StandardCache<K,V>
-
-
Constructor Summary
Constructors Constructor Description StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, org.slf4j.Logger logger)
StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger)
StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger, boolean enableCounters)
StandardCache(String name, boolean useSoftReferences, int initialCapacity, org.slf4j.Logger logger)
StandardCache(String name, boolean useSoftReferences, int initialCapacity, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear the entire cache.void
clearKey(K key)
Clears a specific entry in the cache.V
get(K key)
Retrieve a value from the cache.V
get(K key, ICacheEntryValidityChecker<? super K,? super V> validityChecker)
Retrieve a value from the cache, using the specified validity checker to ensure the entry is still valid.long
getGetCount()
long
getHitCount()
double
getHitRatio()
int
getMaxSize()
long
getMissCount()
double
getMissRatio()
String
getName()
long
getPutCount()
boolean
getUseSoftReferences()
boolean
hasMaxSize()
Set<K>
keySet()
Returns all the keys contained in this cache.void
put(K key, V value)
Insert a new value into the cache.int
size()
-
-
-
Constructor Detail
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, org.slf4j.Logger logger)
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger)
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, org.slf4j.Logger logger)
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger)
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger, boolean enableCounters)
-
-
Method Detail
-
put
public void put(K key, V value)
Description copied from interface:ICache
Insert a new value into the cache.
-
get
public V get(K key, ICacheEntryValidityChecker<? super K,? super V> validityChecker)
Description copied from interface:ICache
Retrieve a value from the cache, using the specified validity checker to ensure the entry is still valid. If the cache already has a default validity checker, this method should override this setting and use the one specified instead.
-
keySet
public Set<K> keySet()
Returns all the keys contained in this cache. Note this method might return keys for entries that are already invalid, so the result of calling
get(Object)
for these keys might benull
.
-
clear
public void clear()
Description copied from interface:ICache
Clear the entire cache.
-
clearKey
public void clearKey(K key)
Description copied from interface:ICache
Clears a specific entry in the cache.
-
getName
public String getName()
-
hasMaxSize
public boolean hasMaxSize()
-
getMaxSize
public int getMaxSize()
-
getUseSoftReferences
public boolean getUseSoftReferences()
-
size
public int size()
-
getPutCount
public long getPutCount()
-
getGetCount
public long getGetCount()
-
getHitCount
public long getHitCount()
-
getMissCount
public long getMissCount()
-
getHitRatio
public double getHitRatio()
-
getMissRatio
public double getMissRatio()
-
-