public interface TimeoutMap<K,V> extends Service
Modifier and Type | Interface and Description |
---|---|
static interface |
TimeoutMap.Listener<K,V> |
Modifier and Type | Method and Description |
---|---|
void |
addListener(TimeoutMap.Listener<K,V> listener)
Assign the (singular)
TimeoutMap.Listener |
V |
get(K key)
Looks up the value in the map by the given key.
|
V |
put(K key,
V value,
long timeoutMillis)
Adds the key value pair into the map such that some time after the given timeout the entry will be evicted
|
V |
putIfAbsent(K key,
V value,
long timeoutMillis)
Adds the key value pair into the map if the specified key is not already associated with a value such that some
time after the given timeout the entry will be evicted.
|
V |
remove(K key)
Removes the object with the given key
|
int |
size()
Returns the size of the map
|
V get(K key)
key
- the key of the value to search forint size()
V put(K key, V value, long timeoutMillis)
key
- the keyvalue
- the valuetimeoutMillis
- timeout in millisV putIfAbsent(K key, V value, long timeoutMillis)
key
- the keyvalue
- the valuetimeoutMillis
- timeout in millisV remove(K key)
key
- key for the object to removevoid addListener(TimeoutMap.Listener<K,V> listener)
TimeoutMap.Listener
listener
- the new listenerApache Camel