Class: LocalMap

vertx-js/local_map~ LocalMap

new LocalMap()

Local maps can be used to share data safely in a single Vert.x instance.

Source:

Methods

clear()

Clear all entries in the map
Source:

close()

Close and release the map
Source:

get(key) → {Object}

Get a value from the map
Parameters:
Name Type Description
key Object the key
Source:
Returns:
the value, or null if none
Type
Object

isEmpty() → {boolean}

Source:
Returns:
  • true if there are zero entries in the map
  • Type
    boolean

put(key, value) → {Object}

Put an entry in the map
Parameters:
Name Type Description
key Object the key
value Object the value
Source:
Returns:
return the old value, or null if none
Type
Object

putIfAbsent(key, value) → {Object}

Put the entry only if there is no existing entry for that key
Parameters:
Name Type Description
key Object the key
value Object the value
Source:
Returns:
the old value or null, if none
Type
Object

remove(key) → {Object}

Remove an entry from the map
Parameters:
Name Type Description
key Object the key
Source:
Returns:
the old value
Type
Object

removeIfPresent(key, value) → {boolean}

Remove the entry only if there is an entry with the specified key and value
Parameters:
Name Type Description
key Object the key
value Object the value
Source:
Returns:
true if removed
Type
boolean

replace(key, value) → {Object}

Replace the entry only if there is an existing entry with the key
Parameters:
Name Type Description
key Object the key
value Object the new value
Source:
Returns:
the old value
Type
Object

replaceIfPresent(key, oldValue, newValue) → {boolean}

Replace the entry only if there is an existing entry with the specified key and value
Parameters:
Name Type Description
key Object the key
oldValue Object the old value
newValue Object the new value
Source:
Returns:
true if removed
Type
boolean

size() → {number}

Get the size of the map
Source:
Returns:
the number of entries in the map
Type
number