Interface UserSettings

All Known Implementing Classes:
UserSettingsProvider

public sealed interface UserSettings permits UserSettingsProvider
User settings interface to manage user settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    createUser(int id)
    Creates a new user and checks if the user already exists.
    void
    deleteUser(int id)
    Deletes a user.
    boolean
    existsUser(int id)
    Checks if a user exists.
    Obtains the first join date of a user.
    long
    Obtains the first join time of a user.
    Retrieves the last quit date of a user identified by the given ID.
    long
    Retrieves the last quit time of a user.
    int
    getOnline(int id)
    Retrieves the online status of a user identified by the given ID.
    void
    setLastQuitTime(int id, long time)
    Sets the last quit time for a user identified by the given ID.
    void
    setOnline(int id, int online)
    Sets the online status of a user identified by the given ID.
  • Method Details

    • existsUser

      boolean existsUser(int id)
      Checks if a user exists.
      Parameters:
      id - The id of the user.
      Returns:
      True if the user exists, otherwise false.
    • createUser

      void createUser(int id)
      Creates a new user and checks if the user already exists. If the user already exists, the method will return without creating a new user.
      Parameters:
      id - The id of the user.
    • deleteUser

      void deleteUser(int id)
      Deletes a user.
      Parameters:
      id - The id of the user.
    • getFirstJoinTime

      long getFirstJoinTime(int id)
      Obtains the first join time of a user.
      Parameters:
      id - The id of the user.
      Returns:
      The first join time of the user.
    • getFirstJoinDate

      String getFirstJoinDate(int id)
      Obtains the first join date of a user.
      Parameters:
      id - The id of the user.
      Returns:
      The first join date of the user.
    • setLastQuitTime

      void setLastQuitTime(int id, long time)
      Sets the last quit time for a user identified by the given ID. This method updates the last quit time of the user in the user settings database.
      Parameters:
      id - The ID of the user.
      time - The last quit time to set for the user, represented as a long value.
    • getLastQuitTime

      long getLastQuitTime(int id)
      Retrieves the last quit time of a user.
      Parameters:
      id - The id of the user.
      Returns:
      The last quit time of the user as a long value.
    • getLastQuitDate

      String getLastQuitDate(int id)
      Retrieves the last quit date of a user identified by the given ID.
      Parameters:
      id - The ID of the user.
      Returns:
      The last quit date of the user as a string.
    • setOnline

      void setOnline(int id, int online)
      Sets the online status of a user identified by the given ID. This method updates the online status of the user in the user settings database.
      Parameters:
      id - The ID of the user.
      online - The online status to set for the user, represented as a byte value.
    • getOnline

      int getOnline(int id)
      Retrieves the online status of a user identified by the given ID. This method retrieves the online status of the user from the user settings database.
      Parameters:
      id - The ID of the user.
      Returns:
      The online status of the user as a boolean value. True indicates that the user is online, false indicates that the user is offline.