def replace_if_same(self, key, old_value, new_value):
check_not_none(key, "<STR_LIT>")<EOL>check_not_none(old_value, "<STR_LIT>")<EOL>check_not_none(new_value, "<STR_LIT>")<EOL>return self._encode_invoke(transactional_map_replace_if_same_codec, key=self._to_data(key),<EOL>old_value=self._to_data(old_value), new_value=self._to_data(new_value))<EOL>
Transactional implementation of :func:`Map.replace_if_same(key, old_value, new_value)
<hazelcast.proxy.map.Map.replace_if_same>`

The object to be replaced will be accessible only in the current transaction context till the transaction is
committed.

:param key: (object), the specified key.
:param old_value: (object), replace the key value if it is the old value.
:param new_value: (object), the new value to replace the old value.
:return: (bool), ``true`` if the value was replaced, ``false`` otherwise.