Represents a user in the system.
This class encapsulates the details of a user, including their ID, username, password, salt used for password hashing, and role within the system.
- Version
- 1.0
- Since
- 2024-06-23
- See also
- model.UserDAO
-
controller.UserController
- Author
- Muhammad Rizal Anditama Nugraha
◆ User() [1/3]
Default constructor for creating an empty user object.
◆ User() [2/3]
model.User.User |
( |
int |
userID, |
|
|
String |
username, |
|
|
String |
password, |
|
|
byte[] |
salt, |
|
|
String |
role |
|
) |
| |
|
inline |
Constructs a new User with the specified details.
- Parameters
-
userID | the user ID |
username | the username |
password | the password |
salt | the salt used for password hashing |
role | the role of the user |
◆ User() [3/3]
model.User.User |
( |
int |
userID, |
|
|
String |
username, |
|
|
String |
password, |
|
|
byte[] |
salt |
|
) |
| |
|
inline |
Constructs a new User with the specified details and a default role of "member".
- Parameters
-
userID | the user ID |
username | the username |
password | the password |
salt | the salt used for password hashing |
◆ getPassword()
String model.User.getPassword |
( |
| ) |
|
|
inline |
Gets the password.
- Returns
- the password
◆ getRole()
String model.User.getRole |
( |
| ) |
|
|
inline |
Gets the role of the user.
- Returns
- the role
◆ getSalt()
byte[] model.User.getSalt |
( |
| ) |
|
|
inline |
Gets the salt used for password hashing.
- Returns
- the salt
◆ getUserID()
int model.User.getUserID |
( |
| ) |
|
|
inline |
Gets the user ID.
- Returns
- the user ID
◆ getUsername()
String model.User.getUsername |
( |
| ) |
|
|
inline |
Gets the username.
- Returns
- the username
◆ setPassword()
void model.User.setPassword |
( |
String |
password | ) |
|
|
inline |
Sets the password.
- Parameters
-
password | the password to set |
◆ setRole()
void model.User.setRole |
( |
String |
role | ) |
|
|
inline |
Sets the role of the user.
- Parameters
-
◆ setSalt()
void model.User.setSalt |
( |
byte[] |
salt | ) |
|
|
inline |
Sets the salt used for password hashing.
- Parameters
-
◆ setUserID()
void model.User.setUserID |
( |
int |
userID | ) |
|
|
inline |
Sets the user ID.
- Parameters
-
◆ setUsername()
void model.User.setUsername |
( |
String |
username | ) |
|
|
inline |
Sets the username.
- Parameters
-
username | the username to set |
The documentation for this class was generated from the following file: