Class User
java.lang.Object
com.needleandstitch.pavuk.model.User
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionUser()
Default constructor.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.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. -
Method Summary
Modifier and TypeMethodDescriptionGets the date of birth of the user.getEmail()
Gets the email of the user.Gets the first name of the user.getId()
Gets the unique identifier of the user.Gets the last name of the user.Gets the whether the user is subscribed to the newsletter.Gets the last time user was online.Gets the password of the user.getPhone()
Gets the phone number of the user.Gets the registration date of the user.getRole()
Gets the role of the user.Gets the status of the user.Gets the tailor of the user.void
setDateOfBirth
(LocalDate dateOfBirth) Sets the date of birth of the user.void
Sets the email of the user.void
setFirstName
(String firstName) Sets the first name of the user.void
Sets the unique identifier of the user.void
setLastName
(String lastName) Sets the last name of the user.void
setNewsletterSubscription
(Boolean newsletterSubscription) Sets the whether the user is subscribed to the newsletter.void
setOnlineDate
(LocalDateTime onlineDate) Sets the last time user was online.void
setPassword
(String password) Sets the password of the user.void
Sets the phone number of the user.void
setRegistrationDate
(LocalDateTime registrationDate) Sets the registration date of the user.void
Sets the role of the user.void
setStatus
(User.Status status) Sets the status of the user.void
Sets the status of the user.
-
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 namelastName
- The user's last namedateOfBirth
- The user's date of birthphone
- The user's phone numberemail
- The user's email addressnewsletterSubscription
- Whether the user is subscribed to the newsletterpassword
- 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 namelastName
- The user's last namedateOfBirth
- The user's date of birthphone
- The user's phone numberemail
- The user's email addressnewsletterSubscription
- Whether the user is subscribed to the newsletterpassword
- The user's passwordrole
- The role assigned to the user
-
-
Method Details
-
getId
-
setId
Sets the unique identifier of the user.- Parameters:
id
- The user ID to set
-
getFirstName
-
setFirstName
Sets the first name of the user.- Parameters:
firstName
- The first name of the user to set
-
getLastName
-
setLastName
Sets the last name of the user.- Parameters:
lastName
- The last name of the user to set
-
getDateOfBirth
-
setDateOfBirth
Sets the date of birth of the user.- Parameters:
dateOfBirth
- User's date of birth to set
-
getPhone
-
setPhone
Sets the phone number of the user.- Parameters:
phone
- User's phone number to set
-
getEmail
-
setEmail
Sets the email of the user.- Parameters:
email
- User's email to set
-
getNewsletterSubscription
Gets the whether the user is subscribed to the newsletter.- Returns:
- True\False depending on subscription status
-
setNewsletterSubscription
Sets the whether the user is subscribed to the newsletter.- Parameters:
newsletterSubscription
- True\False depending on subscription status
-
getPassword
-
setPassword
Sets the password of the user.- Parameters:
password
- User's password to set
-
getRole
-
setRole
-
getTailor
-
setTailor
Sets the status of the user.- Parameters:
tailor
- User's tailor to set
-
getStatus
-
setStatus
Sets the status of the user.- Parameters:
status
- User's status to set
-
getRegistrationDate
Gets the registration date of the user.- Returns:
- User's registration date
-
setRegistrationDate
Sets the registration date of the user.- Parameters:
registrationDate
- User's registration date to set
-
getOnlineDate
Gets the last time user was online.- Returns:
- The last time user was online
-
setOnlineDate
Sets the last time user was online.- Parameters:
onlineDate
- The last time user was online to set
-