def alter_and_get(self, function):
check_not_none(function, "<STR_LIT>")<EOL>return self._encode_invoke(atomic_long_alter_and_get_codec, function=self._to_data(function))<EOL>
Alters the currently stored value by applying a function on it and gets the result.

:param function: (Function), A stateful serializable object which represents the Function defined on
    server side.
    This object must have a serializable Function counter part registered on server side with the actual
    ``org.hazelcast.core.IFunction`` implementation.
:return: (long), the new value.