Class RegisterDto
java.lang.Object
me.josephsf.jobportaljosephsfeir.dto.RegisterDto
Data Transfer Object for user registration.
This class encapsulates the information required for registering a new user in the Job Portal system. It includes fields for username, email, password, and the user's requested role(s). Validation constraints ensure data integrity during the registration process.
The validation constraints include:
- Username must be between 3 and 20 characters
- Email must be valid and not exceed 50 characters
- Password must be between 6 and 40 characters
If no role is specified during registration, the system defaults the user to the CANDIDATE role.
- Since:
- 2025-05-14
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for deserialization.Constructs a new RegisterDto with all required fields. -
Method Summary
Modifier and TypeMethodDescriptiongetEmail()Gets the email address.Gets the password.getRole()Gets the set of roles.Gets the username.voidSets the email address.voidsetPassword(String password) Sets the password.voidSets the set of roles.voidsetUsername(String username) Sets the username.
-
Constructor Details
-
RegisterDto
public RegisterDto()Default constructor for deserialization. -
RegisterDto
Constructs a new RegisterDto with all required fields.- Parameters:
username- The username for the new accountemail- The email address for the new accountpassword- The password for the new accountrole- The set of roles for the new account
-
-
Method Details
-
getUsername
Gets the username.- Returns:
- The username
-
setUsername
Sets the username.- Parameters:
username- The username to set
-
getEmail
Gets the email address.- Returns:
- The email address
-
setEmail
Sets the email address.- Parameters:
email- The email address to set
-
getPassword
Gets the password.- Returns:
- The password
-
setPassword
Sets the password.- Parameters:
password- The password to set
-
getRole
Gets the set of roles.- Returns:
- The set of roles
-
setRole
Sets the set of roles.- Parameters:
role- The set of roles to set
-