Collections.Map.Concurrent.replaceIfEqualToGivenValue()

Signature

boolean replaceIfEqualToGivenValue ( Object map ,Object key ,Object oldValue, Object newValue )

Domain

ACTION

Description

Replace entry for key only if currently mapped to given value. The action is performed atomically.

Parameters

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

Returns

TypeDescription
booleantrue if the value was replaced, false otherwise .

Cautions

none