vertx-lang-scala-docs_2.12 3.4.0 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package core
  Definition Classes
    scala
-  package shareddata
  Definition Classes
    core
- AsyncMap
- Counter
- LocalMap
- Lock
- SharedData

c

io.vertx.scala.core.shareddata

# LocalMap 

###
Companion object LocalMap

#### 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.

Linear Supertypes
AnyRef, Any
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. LocalMap
2. AnyRef
3. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new LocalMap(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[K], arg1: scala.reflect.api.JavaUniverse.TypeTag[V])

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
5.  def asJava: AnyRef
6.  def clear(): Unit

   Clear all entries in the map

7.  def clone(): AnyRef
   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @throws( ... )
8.  def close(): Unit

   Close and release the map

9.  final def eq(arg0: AnyRef): Boolean
   Definition Classes
     AnyRef
10.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
11.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
12.  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

13.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
14.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
15.  def isEmpty(): Boolean

    returns

      true if there are zero entries in the map

16.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
17.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
18.  final def notify(): Unit
    Definition Classes
      AnyRef
19.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
20.  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

21.  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

22.  def remove(key: K): V

    Remove an entry from the map

    Remove an entry from the map

    key

      the key

    returns

      the old value

23.  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

24.  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

25.  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

26.  def size(): Int

    Get the size of the map

    Get the size of the map

    returns

      the number of entries in the map

27.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
28.  def toString(): String
    Definition Classes
      AnyRef → Any
29.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
30.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
31.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

### Inherited from AnyRef

### Inherited from Any

### Ungrouped