public interface KeyValueStore<K,V> extends AdvancedKeyValueSource<K,V>
This interface contains no methods that expose or mutate the cache state.
Modifier and Type | Method and Description |
---|---|
void |
put(K key,
V value)
Insert a new value and call the writer, if registered.
|
void |
putAll(Map<? extends K,? extends V> valueMap)
Insert all elements of the map into the cache and call the writer, if registered.
|
void |
remove(K key)
Remove a mapping from the cache and call the writer, if registered.
|
void |
removeAll(Iterable<? extends K> keys)
Remove mappings from the cache and call the writer, if registered.
|
getAll, prefetch, prefetchAll
get
void put(K key, V value)
key
- key with which the specified value is associatedvalue
- value to be associated with the specified keyCache.put(Object, Object)
void putAll(Map<? extends K,? extends V> valueMap)
valueMap
- Map of keys with associated values to be inserted in the cacheNullPointerException
- if one of the specified keys is nullvoid remove(K key)
key
- key which mapping is to be removed from the cache, not nullCache.remove(K)
void removeAll(Iterable<? extends K> keys)
keys
- keys is to be removed from the cacheCache.removeAll(java.lang.Iterable<? extends K>)
cache2k API documentation. Copyright © 2000–2016 headissue GmbH, Munich.