class LocalMap[K, V] extends AnyRef
Local maps can be used to share data safely in a single Vert.x instance.
The map only allows immutable keys and values in the map, OR certain mutable objects such as io.vertx.scala.core.buffer.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.
- Alphabetic
- By Inheritance
- LocalMap
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new LocalMap(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[K], arg1: scala.reflect.api.JavaUniverse.TypeTag[V])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJava: AnyRef
-
def
clear(): Unit
Clear all entries in the map
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
close(): Unit
Close and release the map
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(key: K): V
Get a value from the map
Get a value from the map
- key
the key
- returns
the value, or null if none
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
isEmpty(): Boolean
- returns
true if there are zero entries in the map
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
put(key: K, value: V): V
Put an entry in the map
Put an entry in the map
- key
the key
- value
the value
- returns
return the old value, or null if none
-
def
putIfAbsent(key: K, value: V): V
Put the entry only if there is no existing entry for that key
Put the entry only if there is no existing entry for that key
- key
the key
- value
the value
- returns
the old value or null, if none
-
def
remove(key: K): V
Remove an entry from the map
Remove an entry from the map
- key
the key
- returns
the old value
-
def
removeIfPresent(key: K, value: V): Boolean
Remove the entry only if there is an entry with the specified key and value
Remove the entry only if there is an entry with the specified key and value
- key
the key
- value
the value
- returns
true if removed
-
def
replace(key: K, value: V): V
Replace the entry only if there is an existing entry with the key
Replace the entry only if there is an existing entry with the key
- key
the key
- value
the new value
- returns
the old value
-
def
replaceIfPresent(key: K, oldValue: V, newValue: V): Boolean
Replace the entry only if there is an existing entry with the specified key and value
Replace the entry only if there is an existing entry with the specified key and value
- key
the key
- oldValue
the old value
- newValue
the new value
- returns
true if removed
-
def
size(): Int
Get the size of the map
Get the size of the map
- returns
the number of entries in the map
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )