Package org.thymeleaf.cache
Class StandardCache<K,V>
Object
org.thymeleaf.cache.StandardCache<K,V>
- Type Parameters:
K
- The type of the cache keysV
- The type of the cache values
- All Implemented Interfaces:
ICache<K,
V>
- Since:
- 2.0.0
- Author:
- Daniel Fernández, Guven Demir
-
Constructor Summary
ConstructorDescriptionStandardCache
(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
Modifier and TypeMethodDescriptionvoid
clear()
Clear the entire cache.void
Clears a specific entry in the cache.Retrieve a value from the cache.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
long
double
int
long
double
getName()
long
boolean
boolean
keySet()
Returns all the keys contained in this cache.void
Insert a new value into the cache.int
size()
-
Constructor Details
-
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 Details
-
put
Description copied from interface:ICache
Insert a new value into the cache.
-
get
Description copied from interface:ICache
Retrieve a value from the cache.
-
get
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
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
Description copied from interface:ICache
Clears a specific entry in the cache.
-
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()
-