K - The type of the keyV - The type of the valuepublic interface Cache<K,V>
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all cached values.
|
boolean |
contains(K key)
Checks whether this cache contains a value for the given key.
|
V |
get(K key)
Returns a value from the cache.
|
void |
remove(K key)
Removes the cached value for the given key.
|
int |
size()
Returns the number of currently cached values.
|
boolean contains(K key)
ValueRetriever will be made! Note that it is legal
for this method to return true but for a following
get(Object) to return null (see WeakHashMap) for
a possible explanation).key - The key to check fortrue if this cache contains a value for the given key,
false otherwiseV get(K key) throws CacheException
ValueRetriever is asked to
retrieve the value. This operation may result in a CacheException
to be thrown. The returned value is cached if it is non-null.key - The key to get the value fornull if there is no value for
the keyCacheException - if an error occurs retrieving the value from the underlying
ValueRetrievervoid remove(K key)
key - The key to remove the cached value forvoid clear()
int size()
Copyright © 2026. All rights reserved.