Class DittoPresenceObserver

java.lang.Object
com.ditto.java.DittoPresenceObserver
All Implemented Interfaces:
Closeable, AutoCloseable

public final class DittoPresenceObserver extends Object implements Closeable

A token representing an active presence graph observation.

This observer is returned by DittoPresence.observe(DittoPresence.PresenceGraphChangedListener) when you register a listener for presence graph changes. Call close() to stop observing and unsubscribe the handler.

This class implements Closeable, allowing it to be used with try-with-resources statements for automatic cleanup.

See Also:
  • Method Details

    • close

      public void close() throws IOException

      Stops observing presence graph changes and unsubscribes the listener.

      After calling this method, the associated listener will no longer receive presence graph change notifications. This method is idempotent and can be called multiple times safely.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException - if an I/O error occurs during cleanup.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object