public class MapBackedStore<V> extends BaseTransientStore<V>
config| Constructor and Description |
|---|
MapBackedStore(TransientStoreConfig<V> config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Iterator<Map.Entry<String,V>> |
entries()
Returns an iterator of (key, value) tuples.
|
V |
get(String key)
Returns a value corresponding to the given look-up key if exists, null otherwise.
|
V |
put(String key,
V value)
Stores the given (key, value) in this store overriding the existing value.
|
V |
putIfAbsent(String key,
V value)
Stores the given (key, value) tuple in this store only if it does not exists.
|
V |
remove(String key)
Removes the (key, value) tuple from this store if the key exists.
|
int |
size()
Returns number of entries.
|
addListener, fireListeners, getConfig, keys, removeListener, valuespublic MapBackedStore(TransientStoreConfig<V> config)
public V get(String key)
TransientStorekey - look-up keypublic V put(String key, V value)
TransientStorekey - look-up keyvalue - value to storepublic V putIfAbsent(String key, V value)
TransientStorekey - look-up keyvalue - value to storepublic V remove(String key)
TransientStorekey - look-up keypublic Iterator<Map.Entry<String,V>> entries()
TransientStorepublic int size()
TransientStoreCopyright © 2017 The Apache Software Foundation. All rights reserved.