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, values
public MapBackedStore(TransientStoreConfig<V> config)
public V get(String key)
TransientStore
key
- look-up keypublic V put(String key, V value)
TransientStore
key
- look-up keyvalue
- value to storepublic V putIfAbsent(String key, V value)
TransientStore
key
- look-up keyvalue
- value to storepublic V remove(String key)
TransientStore
key
- look-up keypublic Iterator<Map.Entry<String,V>> entries()
TransientStore
public int size()
TransientStore
Copyright © 1970 The Apache Software Foundation. All rights reserved.