replace
Atomically replaces the entry for a key only if currently mapped to the specified value.
Return
true if the value was replaced
Parameters
key
the key whose mapping is to be replaced
old Value
the value expected to be associated with the key
new Value
the value to be associated with the key
Atomically replaces the entry for a key only if currently mapped to some value.
Return
the previous value associated with the key, or null if there was no mapping
Parameters
key
the key whose mapping is to be replaced
value
the value to be associated with the key