Package io.github.coho04.mysql.entities
Class User
java.lang.Object
io.github.coho04.mysql.entities.User
- All Implemented Interfaces:
QueryHelper
Represents a User in the application.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.coho04.mysql.interfaces.QueryHelper
QueryHelper.ResultSetHandler<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drop
(boolean database) Drops the user from the database.getName()
Retrieves the name of the user.void
removePermission
(Permissions permissions) Removes the specified permissions from the user.void
removePermissionToDatabase
(Permissions PERMISSION, Database database) Removes the specified permissions from the user for the given database.void
setPassword
(String password) Sets the password for the user.void
setPermission
(Permissions permissions) Sets the permissions for the user.void
setPermissionToDatabase
(Permissions permissions, Database database) Sets the specified permissions to the given database for the current user.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.coho04.mysql.interfaces.QueryHelper
executeQuery, executeQuery, executeUpdate, executeUpdate
-
Constructor Details
-
User
Represents a User in the application.
-
-
Method Details
-
getName
Retrieves the name of the user.- Returns:
- The name of the user.
-
drop
public void drop(boolean database) Drops the user from the database. If the database parameter is true, it also drops the corresponding database.- Parameters:
database
- true if the database should also be dropped, false otherwise
-
setPermission
Sets the permissions for the user.- Parameters:
permissions
- The permissions to be set for the user.
-
setPermissionToDatabase
Sets the specified permissions to the given database for the current user.- Parameters:
permissions
- The permissions to be set for the database.database
- The database for which the permissions are to be set.
-
removePermission
Removes the specified permissions from the user.- Parameters:
permissions
- The permissions to be removed from the user.
-
removePermissionToDatabase
Removes the specified permissions from the user for the given database.- Parameters:
PERMISSION
- The permissions to be removed from the user.database
- The database from which to remove the permissions.
-
setPassword
Sets the password for the user.- Parameters:
password
- The password to be set for the user.
-