Class User

java.lang.Object
com.needleandstitch.pavuk.model.User

@Entity public class User extends Object
An entity class for user.

This class serves as a model for the user table in the database.

Since:
15.12.2024
Version:
1.0.0
Author:
Needle & Stitch
  • Constructor Details

    • User

      public User()
      Default constructor.
    • User

      public User(String firstName, String lastName, LocalDate dateOfBirth, String phone, String email, Boolean newsletterSubscription, String password)
      Constructor to create a new user with the specified information.
      Parameters:
      firstName - The user's first name
      lastName - The user's last name
      dateOfBirth - The user's date of birth
      phone - The user's phone number
      email - The user's email address
      newsletterSubscription - Whether the user is subscribed to the newsletter
      password - The user's password
    • User

      public User(String firstName, String lastName, LocalDate dateOfBirth, String phone, String email, Boolean newsletterSubscription, String password, Role role)
      Constructor to create a new user with the specified information.
      Parameters:
      firstName - The user's first name
      lastName - The user's last name
      dateOfBirth - The user's date of birth
      phone - The user's phone number
      email - The user's email address
      newsletterSubscription - Whether the user is subscribed to the newsletter
      password - The user's password
      role - The role assigned to the user
  • Method Details

    • getId

      public Long getId()
      Gets the unique identifier of the user.
      Returns:
      The user ID
    • setId

      public void setId(Long id)
      Sets the unique identifier of the user.
      Parameters:
      id - The user ID to set
    • getFirstName

      public String getFirstName()
      Gets the first name of the user.
      Returns:
      The first name of the user
    • setFirstName

      public void setFirstName(String firstName)
      Sets the first name of the user.
      Parameters:
      firstName - The first name of the user to set
    • getLastName

      public String getLastName()
      Gets the last name of the user.
      Returns:
      The last name of the user
    • setLastName

      public void setLastName(String lastName)
      Sets the last name of the user.
      Parameters:
      lastName - The last name of the user to set
    • getDateOfBirth

      public LocalDate getDateOfBirth()
      Gets the date of birth of the user.
      Returns:
      User's date of birth
    • setDateOfBirth

      public void setDateOfBirth(LocalDate dateOfBirth)
      Sets the date of birth of the user.
      Parameters:
      dateOfBirth - User's date of birth to set
    • getPhone

      public String getPhone()
      Gets the phone number of the user.
      Returns:
      User's phone number
    • setPhone

      public void setPhone(String phone)
      Sets the phone number of the user.
      Parameters:
      phone - User's phone number to set
    • getEmail

      public String getEmail()
      Gets the email of the user.
      Returns:
      User's email
    • setEmail

      public void setEmail(String email)
      Sets the email of the user.
      Parameters:
      email - User's email to set
    • getNewsletterSubscription

      public Boolean getNewsletterSubscription()
      Gets the whether the user is subscribed to the newsletter.
      Returns:
      True\False depending on subscription status
    • setNewsletterSubscription

      public void setNewsletterSubscription(Boolean newsletterSubscription)
      Sets the whether the user is subscribed to the newsletter.
      Parameters:
      newsletterSubscription - True\False depending on subscription status
    • getPassword

      public String getPassword()
      Gets the password of the user.
      Returns:
      User's password
    • setPassword

      public void setPassword(String password)
      Sets the password of the user.
      Parameters:
      password - User's password to set
    • getRole

      public Role getRole()
      Gets the role of the user.
      Returns:
      User's role
    • setRole

      public void setRole(Role role)
      Sets the role of the user.
      Parameters:
      role - User's role to set
    • getTailor

      public Tailor getTailor()
      Gets the tailor of the user.
      Returns:
      User's tailor
    • setTailor

      public void setTailor(Tailor tailor)
      Sets the status of the user.
      Parameters:
      tailor - User's tailor to set
    • getStatus

      public User.Status getStatus()
      Gets the status of the user.
      Returns:
      User's status
    • setStatus

      public void setStatus(User.Status status)
      Sets the status of the user.
      Parameters:
      status - User's status to set
    • getRegistrationDate

      public LocalDateTime getRegistrationDate()
      Gets the registration date of the user.
      Returns:
      User's registration date
    • setRegistrationDate

      public void setRegistrationDate(LocalDateTime registrationDate)
      Sets the registration date of the user.
      Parameters:
      registrationDate - User's registration date to set
    • getOnlineDate

      public LocalDateTime getOnlineDate()
      Gets the last time user was online.
      Returns:
      The last time user was online
    • setOnlineDate

      public void setOnlineDate(LocalDateTime onlineDate)
      Sets the last time user was online.
      Parameters:
      onlineDate - The last time user was online to set