public interface KeyValueStore<K,V> extends AdvancedKeyValueSource<K,V>
This interface contains no methods that expose or mutate the cache state. This is intended as a reduced interface that has transparent semantics in cache through operation.
|Modifier and Type||Method and Description|
Insert or update a value associated with the given key.
Insert or update all elements of the map into the cache.
Remove a value from the cache that is associated with the key.
Remove mappings from the cache.
key- key with which the specified value is associated
value- value to be associated with the specified key
valueMap- Map of keys with associated values to be inserted in the cache
NullPointerException- if one of the specified keys is null
void remove(K key)
Rationale: It is intentional that this method does not return
a boolean or the previous entry. When operating in cache through
configuration (which means
CacheLoader is registered) a boolean
could mean two different things: the value was present in the cache or
the value was present in the system of authority. The purpose of this
interface is a reduced set of methods that cannot be misinterpreted.
key- key which mapping is to be removed from the cache, not null
cache2k API documentation. Copyright © 2000–2019 headissue GmbH, Munich.