replace
Replaces the entry for the specified key only if it is currently mapped to some value.
Return
the previous value associated with the specified key, or null if there was no mapping for the key. (A null return can also indicate that the map previously associated null with the key.)
Parameters
key with which the specified value is associated
value to be associated with the specified key
Throws
if the key cannot be compared
if key is null and nulls are not supported
Replaces the entry for the specified key only if currently mapped to the specified value.
Return
true if the value was replaced
Parameters
key with which the specified value is associated
value expected to be associated with the specified key
value to be associated with the specified key
Throws
if the key cannot be compared
if key is null and nulls are not supported