Class RegisterDto

java.lang.Object
me.josephsf.jobportaljosephsfeir.dto.RegisterDto

public class RegisterDto extends Object
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 Details

    • RegisterDto

      public RegisterDto()
      Default constructor for deserialization.
    • RegisterDto

      public RegisterDto(String username, String email, String password, Set<String> role)
      Constructs a new RegisterDto with all required fields.
      Parameters:
      username - The username for the new account
      email - The email address for the new account
      password - The password for the new account
      role - The set of roles for the new account
  • Method Details

    • getUsername

      public String getUsername()
      Gets the username.
      Returns:
      The username
    • setUsername

      public void setUsername(String username)
      Sets the username.
      Parameters:
      username - The username to set
    • getEmail

      public String getEmail()
      Gets the email address.
      Returns:
      The email address
    • setEmail

      public void setEmail(String email)
      Sets the email address.
      Parameters:
      email - The email address to set
    • getPassword

      public String getPassword()
      Gets the password.
      Returns:
      The password
    • setPassword

      public void setPassword(String password)
      Sets the password.
      Parameters:
      password - The password to set
    • getRole

      public Set<String> getRole()
      Gets the set of roles.
      Returns:
      The set of roles
    • setRole

      public void setRole(Set<String> role)
      Sets the set of roles.
      Parameters:
      role - The set of roles to set