IMapK, VReplace Method (K, V)Hazelcast .Net Client Class Library
Replaces the entry for a key only if currently mapped to some value.

Namespace: Hazelcast.Core
Assembly: HazelcastClient3x (in HazelcastClient3x.dll) Version: 3.3.0.12
Syntax

V Replace(
	K key,
	V value
)

Parameters

key
Type: K
key
value
Type: V
value

Return Value

Type: V
previous value associated with key or null if there was no mapping for key .
Remarks

Replaces the entry for a key only if currently mapped to some value. This is equivalent to
if (map.ContainsKey(key))
    return map.put(key, value);
else 
    return null;
> except that the action is performed atomically.

Warning:

This method uses GetHashCode and Equals of binary form of the key, not the actual implementations of GetHashCode and Equals defined in key's class.
See Also

Reference