public interface Cache<K,V>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Delete all entries from the cache.
|
void |
delete(K key)
Delete a key-value pair from the cache.
|
void |
deleteAll(java.util.List<K> keys)
Delete one or more key-value pairs from the cache.
|
V |
get(K key)
Look up a value in the cache.
|
java.util.Map<K,V> |
getAll(java.util.List<K> keys)
Look up one or more values in the cache.
|
Stats |
getStatistics()
Get cache statistics.
|
void |
put(K key,
V value)
Cache a key-value pair.
|
void |
putAll(java.util.Map<K,V> map)
Cache one or more key-value pairs.
|
long |
size() |
void clear()
void delete(K key)
key
- key corresponding to valuevoid deleteAll(java.util.List<K> keys)
keys
- List containing the keys to deleteV get(K key)
key
- key corresponding to valuenull
if key is not in cache or if
value is expiredjava.util.Map<K,V> getAll(java.util.List<K> keys)
keys
- List containing the keys to look upStats getStatistics()
void put(K key, V value)
key
- key associated with valuevalue
- value associated with keyvoid putAll(java.util.Map<K,V> map)
map
- map containing key-value pairs to cachelong size()