Class UserSettingsProvider
java.lang.Object
de.murmelmeister.murmelapi.user.settings.UserSettingsProvider
- All Implemented Interfaces:
UserSettings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateUser(int id) Creates a new user and checks if the user already exists.voiddeleteUser(int id) Deletes a user.booleanexistsUser(int id) Checks if a user exists.getFirstJoinDate(int id) Obtains the first join date of a user.longgetFirstJoinTime(int id) Obtains the first join time of a user.getLastQuitDate(int id) Retrieves the last quit date of a user.longgetLstQuitTime(int id) Retrieves the last quit time of a user.booleanisOnline(int id) Retrieves the online status of a user identified by the given ID.voidsetLastQuitTime(int id, long time) Sets the last quit time for the specified user.voidsetOnline(int id, boolean isOnline) Sets the online status of a user identified by the given ID.
-
Constructor Details
-
UserSettingsProvider
-
-
Method Details
-
existsUser
public boolean existsUser(int id) Description copied from interface:UserSettingsChecks if a user exists.- Specified by:
existsUserin interfaceUserSettings- 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:UserSettingsCreates 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:
createUserin interfaceUserSettings- Parameters:
id- The id of the user.
-
deleteUser
public void deleteUser(int id) Description copied from interface:UserSettingsDeletes a user.- Specified by:
deleteUserin interfaceUserSettings- Parameters:
id- The id of the user.
-
getFirstJoinTime
public long getFirstJoinTime(int id) Description copied from interface:UserSettingsObtains the first join time of a user.- Specified by:
getFirstJoinTimein interfaceUserSettings- Parameters:
id- The id of the user.- Returns:
- The first join time of the user.
-
getFirstJoinDate
Description copied from interface:UserSettingsObtains the first join date of a user.- Specified by:
getFirstJoinDatein interfaceUserSettings- Parameters:
id- The id of the user.- Returns:
- The first join date of the user.
-
getLstQuitTime
public long getLstQuitTime(int id) Description copied from interface:UserSettingsRetrieves the last quit time of a user.- Specified by:
getLstQuitTimein interfaceUserSettings- Parameters:
id- The id of the user.- Returns:
- The last quit time of the user as a long value.
-
setLastQuitTime
public void setLastQuitTime(int id, long time) Description copied from interface:UserSettingsSets the last quit time for the specified user.- Specified by:
setLastQuitTimein interfaceUserSettings- Parameters:
id- The id of the user.time- The last quit time to set for the user.
-
getLastQuitDate
Description copied from interface:UserSettingsRetrieves the last quit date of a user.- Specified by:
getLastQuitDatein interfaceUserSettings- Parameters:
id- The id of the user.- Returns:
- The last quit date of the user as a String formatted by the SimpleDateFormat.
-
setOnline
public void setOnline(int id, boolean isOnline) Description copied from interface:UserSettingsSets 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:
setOnlinein interfaceUserSettings- Parameters:
id- The ID of the user.isOnline- The online status to set for the user, represented as a byte value.
-
isOnline
public boolean isOnline(int id) Description copied from interface:UserSettingsRetrieves 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:
isOnlinein interfaceUserSettings- 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.
-