def get_and_alter(self, function):
        """
        Alters the currently stored value by applying a function on it on and gets the old value.

        :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 old value.
        """
        check_not_none(function, "function can't be None")
        return self._encode_invoke(atomic_long_get_and_alter_codec, function=self._to_data(function))
def get_and_alter ( self , function ) : check_not_none ( function , "function can't be None" ) return self . _encode_invoke ( atomic_long_get_and_alter_codec , function = self . _to_data ( function ) )
Alters the currently stored value by applying a function on it on and gets the old value.

        :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 old value.