Collections.Map.Concurrent.replaceIfEqualToGivenValue()
Signature
boolean replaceIfEqualToGivenValue ( Object map ,Object key ,Object oldValue, Object newValue )
Description
Replace entry for key only if currently mapped to given value. The action is performed atomically.
Parameters
Name | Type | Description |
map | Object | The concurrent map object |
key | Object | key with which the specified value is to be associated. |
oldvalue | Object | value expected to be associated with the specified key. |
newValue | Object | value to be associated with the specified key. |
Returns
Type | Description |
boolean | true if the value was replaced, false otherwise . |