Class User

java.lang.Object
domain.user.User

public class User extends Object
Class that defines what a User is. Contains get and set methods for each parameter, and validating methods.
  • Constructor Details

    • User

      public User(String userName, String phoneNumber, String password, String eMail)
      Creates a new User with the given parameters. Validates all input before assigning.
      Parameters:
      userName - the username; must not be null or blank
      phoneNumber - the phone number; must be exactly 8 digits
      password - the hashed password
      eMail - the email address; must be a valid email format
  • Method Details

    • getUsername

      public String getUsername()
      Returns the username of this user.
      Returns:
      the username
    • getPhoneNumber

      public String getPhoneNumber()
      Returns the phone number of this user.
      Returns:
      the phone number
    • getEmail

      public String getEmail()
      Returns the email address of this user.
      Returns:
      the email address
    • getPassword

      public String getPassword()
      Returns the password of this user.
      Returns:
      the password hash
    • getID

      public long getID()
      Returns the ID of this user.
      Returns:
      the user ID
    • setId

      public void setId(Long id)
      Sets the ID for this user.
      Parameters:
      id - the ID to assign