Package io.vertx.mutiny.core.shareddata
Class LocalMap<K,V>
- java.lang.Object
 - 
- io.vertx.mutiny.core.shareddata.LocalMap<K,V>
 
 
- 
public class LocalMap<K,V> extends Object
Local maps can be used to share data safely in a single Vert.x instance.By default the map allows immutable keys and values. Custom keys and values should implement
Shareableinterface. The map returns their copies.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.
Since the version 3.4, this class extends the interface. However some methods are only accessible in Java.
NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static TypeArg<LocalMap>__TYPE_ARGTypeArg<K>__typeArg_0TypeArg<V>__typeArg_1 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidclose()booleancontainsKey(Object key)booleancontainsValue(Object value)booleanequals(Object o)Vget(Object key)io.vertx.core.shareddata.LocalMapgetDelegate()VgetOrDefault(Object key, V defaultValue)inthashCode()booleanisEmpty()static <K,V>
LocalMap<K,V>newInstance(io.vertx.core.shareddata.LocalMap arg)static <K,V>
LocalMap<K,V>newInstance(io.vertx.core.shareddata.LocalMap arg, TypeArg<K> __typeArg_K, TypeArg<V> __typeArg_V)Vput(K key, V value)VputIfAbsent(K key, V value)Vremove(Object key)booleanremoveIfPresent(K key, V value)Vreplace(K key, V value)booleanreplaceIfPresent(K key, V oldValue, V newValue)intsize()StringtoString() 
 - 
 
- 
- 
Method Detail
- 
getDelegate
public io.vertx.core.shareddata.LocalMap getDelegate()
 
- 
put
public V put(K key, V value)
- Parameters:
 key- the keyvalue- the value- Returns:
 - return the old value, or null if none
 
 
- 
clear
public void clear()
 
- 
size
public int size()
- Returns:
 - the number of entries in the map
 
 
- 
isEmpty
public boolean isEmpty()
- Returns:
 - true if there are zero entries in the map
 
 
- 
putIfAbsent
public V putIfAbsent(K key, V value)
- Parameters:
 key- the keyvalue- the value- Returns:
 - the old value or null, if none
 
 
- 
removeIfPresent
public boolean removeIfPresent(K key, V value)
- Parameters:
 key- the keyvalue- the value- Returns:
 - true if removed
 
 
- 
replaceIfPresent
public boolean replaceIfPresent(K key, V oldValue, V newValue)
- Parameters:
 key- the keyoldValue- the old valuenewValue- the new value- Returns:
 - true if removed
 
 
- 
replace
public V replace(K key, V value)
- Parameters:
 key- the keyvalue- the new value- Returns:
 - the old value
 
 
- 
close
public void close()
 
- 
containsKey
public boolean containsKey(Object key)
- Parameters:
 key- key whose presence in this map is to be tested- Returns:
 trueif this map contains a mapping for the specified key
 
- 
containsValue
public boolean containsValue(Object value)
- Parameters:
 value- value whose presence in this map is to be tested- Returns:
 
 
- 
getOrDefault
public V getOrDefault(Object key, V defaultValue)
- Parameters:
 key- the key whose associated value is to be returneddefaultValue- the default mapping of the key- Returns:
 - the value to which the specified key is mapped, or 
defaultValueif this map contains no mapping for the key 
 
- 
newInstance
public static <K,V> LocalMap<K,V> newInstance(io.vertx.core.shareddata.LocalMap arg)
 
 - 
 
 -