def alter(self, function):
        """
        Alters the currently stored reference by applying a function on it.

        :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.
        """
        check_not_none(function, "function can't be None")
        return self._encode_invoke(atomic_reference_alter_codec, function=self._to_data(function))
Alters the currently stored reference by applying a function on it.

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