Collections.Map.Concurrent.putIfAbsent()

Signature

Object putIfAbsent ( Object map ,Object key ,Object value )

Domain

ACTION

Description

If the specified key is not already associated with a value, associate it with the given value. The action is performed atomically.

Parameters

NameTypeDescription
mapObjectThe concurrent map object
keyObjectkey with which the specified value is to be associated.
valueObjectvalue to be associated with the specified key.

Returns

TypeDescription
Objectprevious value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key, if the implementation supports null values.

Cautions

none