Interface ObjectStateChange

All Known Subinterfaces:
RealtimeObject
All Known Implementing Classes:
RealtimeObject.Unavailable

public interface ObjectStateChange
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Interface for receiving notifications about Objects synchronization state changes.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Unsubscribes the specified listener from all synchronization state events.
    void
    Unsubscribes all listeners from all synchronization state events.
    on(@NotNull ObjectStateEvent event, ObjectStateChange.Listener listener)
    Subscribes to a specific Objects synchronization state event.
  • Method Details

    • on

      @NonBlocking Subscription on(@NotNull @NotNull ObjectStateEvent event, @NotNull ObjectStateChange.Listener listener)
      Subscribes to a specific Objects synchronization state event.

      This method registers the provided listener to be notified when the specified synchronization state event occurs. The returned subscription can be used to unsubscribe later when the notifications are no longer needed.

      Parameters:
      event - the synchronization state event to subscribe to (SYNCING or SYNCED)
      listener - the listener that will be called when the event occurs
      Returns:
      a subscription object that can be used to unsubscribe from the event
    • off

      @NonBlocking void off(@NotNull ObjectStateChange.Listener listener)
      Unsubscribes the specified listener from all synchronization state events.

      After calling this method, the provided listener will no longer receive any synchronization state event notifications.

      Parameters:
      listener - the listener to unregister from all events
    • offAll

      @NonBlocking void offAll()
      Unsubscribes all listeners from all synchronization state events.

      After calling this method, no listeners will receive any synchronization state event notifications until new listeners are registered.