Package de.murmelmeister.murmelapi.user
Class UserProvider
java.lang.Object
de.murmelmeister.murmelapi.user.UserProvider
- All Implemented Interfaces:
User
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final UserParentprivate final UserPermissionprivate final PlayTimeprivate final UserSettings -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateNewUser(UUID uuid, String username) Create a new user and check if the user already exists.private voidcreateTable(String tableName) voiddeleteUser(UUID uuid) Deletes a user.booleanexistsUser(String username) Checks if a user exists.booleanexistsUser(UUID uuid) Checks if a user exists.intObtains the id of a user.intObtains the id of a user.getIds()Obtains a list of all ids.Obtains the parent of a user.Obtains the permission of a user.Obtains the play time of a user.Obtains the settings of a user.getUniqueId(int id) Obtains the unique id of a user.getUniqueId(String username) Obtains the unique id of a user.Obtains a list of all unique ids.getUsername(int id) Obtains the username of a user.getUsername(UUID uuid) Obtains the username of a user.Obtains a list of all usernames.voidJoin a user to the server.voidLoad all expired things.voidRenames a user.
-
Field Details
-
settings
-
parent
-
permission
-
playTime
-
-
Constructor Details
-
UserProvider
public UserProvider()
-
-
Method Details
-
createTable
-
existsUser
Description copied from interface:UserChecks if a user exists.- Specified by:
existsUserin interfaceUser- Parameters:
uuid- The unique id of the user.- Returns:
- True if the user exists, otherwise false.
-
existsUser
Description copied from interface:UserChecks if a user exists.- Specified by:
existsUserin interfaceUser- Parameters:
username- The username of the user.- Returns:
- True if the user exists, otherwise false.
-
createNewUser
Description copied from interface:UserCreate a new user and check if the user already exists. If the user already exists, the method will return without creating a new user.- Specified by:
createNewUserin interfaceUser- Parameters:
uuid- The unique id of the user.username- The username of the user.
-
deleteUser
Description copied from interface:UserDeletes a user.- Specified by:
deleteUserin interfaceUser- Parameters:
uuid- The unique id of the user.
-
getId
Description copied from interface:UserObtains the id of a user. -
getId
Description copied from interface:UserObtains the id of a user. -
getUniqueId
Description copied from interface:UserObtains the unique id of a user.- Specified by:
getUniqueIdin interfaceUser- Parameters:
username- The username of the user.- Returns:
- The unique id of the user.
-
getUniqueId
Description copied from interface:UserObtains the unique id of a user.- Specified by:
getUniqueIdin interfaceUser- Parameters:
id- The id of the user.- Returns:
- The unique id of the user.
-
getUsername
Description copied from interface:UserObtains the username of a user.- Specified by:
getUsernamein interfaceUser- Parameters:
uuid- The unique id of the user.- Returns:
- The username of the user.
-
getUsername
Description copied from interface:UserObtains the username of a user. If the id -1 then the method will return "CONSOLE".- Specified by:
getUsernamein interfaceUser- Parameters:
id- The id of the user.- Returns:
- The username of the user.
-
rename
Description copied from interface:UserRenames a user. -
getUniqueIds
Description copied from interface:UserObtains a list of all unique ids.- Specified by:
getUniqueIdsin interfaceUser- Returns:
- A list of all unique ids.
-
getUsernames
Description copied from interface:UserObtains a list of all usernames.- Specified by:
getUsernamesin interfaceUser- Returns:
- A list of all usernames.
-
getIds
Description copied from interface:UserObtains a list of all ids. -
joinUser
Description copied from interface:UserJoin a user to the server. Create a new user if the user does not exist. Check if the user changes their name and rename them. -
loadExpired
public void loadExpired()Description copied from interface:UserLoad all expired things.- Specified by:
loadExpiredin interfaceUser
-
getSettings
Description copied from interface:UserObtains the settings of a user.- Specified by:
getSettingsin interfaceUser- Returns:
- The settings of the user.
-
getParent
Description copied from interface:UserObtains the parent of a user. -
getPermission
Description copied from interface:UserObtains the permission of a user.- Specified by:
getPermissionin interfaceUser- Returns:
- The permission of the user.
-
getPlayTime
Description copied from interface:UserObtains the play time of a user.- Specified by:
getPlayTimein interfaceUser- Returns:
- The play time of the user.
-