Class DittoAuthenticationStatus

java.lang.Object
com.ditto.java.DittoAuthenticationStatus

public final class DittoAuthenticationStatus extends Object

Provides information about the current authentication status.

This class represents the authentication state for a Ditto instance, including whether the instance is currently authenticated and the associated user identifier if available.

Authentication status can be monitored by observing authentication state changes through DittoAuthenticator.observeStatus().

  • Method Details

    • isAuthenticated

      public boolean isAuthenticated()

      Returns true if the Ditto instance is currently authenticated, false otherwise.

      When authenticated, the instance can sync data with remote peers and access protected resources. When not authenticated, sync operations may be restricted depending on your authentication configuration.

      Returns:
      true if authenticated, false otherwise.
    • getUserId

      public @Nullable String getUserId()

      Returns the user identifier if authenticated and one was provided by the authentication service.

      The user ID is provided by the authentication service during login and uniquely identifies the authenticated user. This value is null when not authenticated or when the authentication service does not provide a user identifier.

      Returns:
      the user ID string if available, or null if not authenticated or no user ID was provided.
    • hashCode

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

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