public class LocalMap<K,V> extends Object
The map only allows immutable keys and values in the map, OR certain mutable objects such as Buffer
instances which will be copied when they are added to the map.
This ensures there is no shared access to mutable state from different threads (e.g. different event loops) in the Vert.x instance, and means you don't have to protect access to that state using synchronization or locks.
NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all entries in the map
|
void |
close()
Close and release the map
|
V |
get(K key)
Get a value from the map
|
Object |
getDelegate() |
boolean |
isEmpty() |
static <K,V> LocalMap |
newInstance(LocalMap arg) |
V |
put(K key,
V value)
Put an entry in the map
|
V |
putIfAbsent(K key,
V value)
Put the entry only if there is no existing entry for that key
|
V |
remove(K key)
Remove an entry from the map
|
boolean |
removeIfPresent(K key,
V value)
Remove the entry only if there is an entry with the specified key and value
|
V |
replace(K key,
V value)
Replace the entry only if there is an existing entry with the key
|
boolean |
replaceIfPresent(K key,
V oldValue,
V newValue)
Replace the entry only if there is an existing entry with the specified key and value
|
int |
size()
Get the size of the map
|
public LocalMap(LocalMap delegate)
public Object getDelegate()
public V get(K key)
key
- the keypublic V put(K key, V value)
key
- the keyvalue
- the valuepublic V remove(K key)
key
- the keypublic void clear()
public int size()
public boolean isEmpty()
public V putIfAbsent(K key, V value)
key
- the keyvalue
- the valuepublic boolean removeIfPresent(K key, V value)
key
- the keyvalue
- the valuepublic boolean replaceIfPresent(K key, V oldValue, V newValue)
key
- the keyoldValue
- the old valuenewValue
- the new valuepublic V replace(K key, V value)
key
- the keyvalue
- the new valuepublic void close()
Copyright © 2016. All rights reserved.