Class UserSettingsProvider

java.lang.Object
de.murmelmeister.murmelapi.user.settings.UserSettingsProvider
All Implemented Interfaces:
UserSettings

public final class UserSettingsProvider extends Object implements UserSettings
  • Field Details

  • Constructor Details

    • UserSettingsProvider

      public UserSettingsProvider(User user)
  • Method Details

    • createTable

      private void createTable(String tableName)
    • existsUser

      public boolean existsUser(int id)
      Description copied from interface: UserSettings
      Checks if a user exists.
      Specified by:
      existsUser in interface UserSettings
      Parameters:
      id - The id of the user.
      Returns:
      True if the user exists, otherwise false.
    • createUser

      public void createUser(int id)
      Description copied from interface: UserSettings
      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.
      Specified by:
      createUser in interface UserSettings
      Parameters:
      id - The id of the user.
    • deleteUser

      public void deleteUser(int id)
      Description copied from interface: UserSettings
      Deletes a user.
      Specified by:
      deleteUser in interface UserSettings
      Parameters:
      id - The id of the user.
    • getFirstJoinTime

      public long getFirstJoinTime(int id)
      Description copied from interface: UserSettings
      Obtains the first join time of a user.
      Specified by:
      getFirstJoinTime in interface UserSettings
      Parameters:
      id - The id of the user.
      Returns:
      The first join time of the user.
    • getFirstJoinDate

      public String getFirstJoinDate(int id)
      Description copied from interface: UserSettings
      Obtains the first join date of a user.
      Specified by:
      getFirstJoinDate in interface UserSettings
      Parameters:
      id - The id of the user.
      Returns:
      The first join date of the user.
    • setLastQuitTime

      public void setLastQuitTime(int id, long time)
      Description copied from interface: UserSettings
      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.
      Specified by:
      setLastQuitTime in interface UserSettings
      Parameters:
      id - The ID of the user.
      time - The last quit time to set for the user, represented as a long value.
    • getLastQuitTime

      public long getLastQuitTime(int id)
      Description copied from interface: UserSettings
      Retrieves the last quit time of a user.
      Specified by:
      getLastQuitTime in interface UserSettings
      Parameters:
      id - The id of the user.
      Returns:
      The last quit time of the user as a long value.
    • getLastQuitDate

      public String getLastQuitDate(int id)
      Description copied from interface: UserSettings
      Retrieves the last quit date of a user identified by the given ID.
      Specified by:
      getLastQuitDate in interface UserSettings
      Parameters:
      id - The ID of the user.
      Returns:
      The last quit date of the user as a string.
    • setOnline

      public void setOnline(int id, int online)
      Description copied from interface: UserSettings
      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.
      Specified by:
      setOnline in interface UserSettings
      Parameters:
      id - The ID of the user.
      online - The online status to set for the user, represented as a byte value.
    • getOnline

      public int getOnline(int id)
      Description copied from interface: UserSettings
      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.
      Specified by:
      getOnline in interface UserSettings
      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.
    • loadTablesIfNotCreated

      private void loadTablesIfNotCreated(User user)