K
- the type of the cache keysV
- the type of the cache valuespublic interface ICache<K,V>
Common interface for all the cache objects used by the template engine.
This is the interface that must be implemented by all cache objects managed
by ICacheManager
implementations.
Modifier and Type | Method and 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.
|
Set<K> |
keySet()
Returns all the keys contained in this cache.
|
void |
put(K key,
V value)
Insert a new value into the cache.
|
void put(K key, V value)
Insert a new value into the cache.
key
- the key of the new entryvalue
- the value to be cachedV get(K key)
Retrieve a value from the cache.
key
- the key of the value to be retrievedV 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. If the cache already has a default validity checker, this method should override this setting and use the one specified instead.
key
- the key of the value to be retrievedvalidityChecker
- the validity checker to be used to ensure the entry is still valid.void clear()
Clear the entire cache.
void clearKey(K key)
Clears a specific entry in the cache.
key
- the key of the entry to be cleared.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
be null.
Copyright © 2016 The THYMELEAF team. All rights reserved.