Class Profile
java.lang.Object
com.serinity.accesscontrol.model.base.IdentifiableEntity
com.serinity.accesscontrol.model.base.TimestampedEntity
com.serinity.accesscontrol.model.Profile
Represents a user's profile in the system. Contains personal information,
contact details, and metadata related to the user's account. Each
Profile is associated with exactly one
User.
The Profile class extends
TimestampedEntity,
which automatically provides createdAt and updatedAt
timestamps.
Fields include:
firstName- The user's first name (optional).lastName- The user's last name (optional).phone- The user's phone number (optional).country- The user's country (optional).state- The user's state/region (optional).aboutMe- A short biography or description (optional).username- Auto-generated unique username, immutable after creation.profileImageUrl- Optional URL to the user's profile image.user- TheUserthis profile belongs to.
NOTE: The username field is generated automatically when the
profile is created and cannot be modified manually. This ensures uniqueness
across the system.
NOTE: This class is declared final to prevent inheritance and ensure
session integrity.
- Since:
- 2026-02-03
- Version:
- 1.0
- Author:
- @ZouariOmar (zouariomar20@gmail.com)
- See Also:
-
Field Summary
Fields inherited from class TimestampedEntity
createdAt, updatedAtFields inherited from class IdentifiableEntity
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the short biography text.Returns the country.Returns the first name.Returns the gender.Returns the last name.getPhone()Returns the phone number.Returns the profile image URL.getState()Returns the state/region.getUser()Returns the owning user.Returns the unique username.voidsetAboutMe(String aboutMe) Sets the short biography text.voidsetCountry(String country) Sets the country.voidsetFirstName(String firstName) Sets the first name.voidSets the gender.voidsetLastName(String lastName) Sets the last name.voidSets the phone number.voidsetProfileImageUrl(String profileImageUrl) Sets the profile image URL.voidSets the state/region.voidSets the owning user.voidsetUsername(String username) Sets the unique username.Methods inherited from class IdentifiableEntity
getId
-
Constructor Details
-
Profile
public Profile()Creates an empty user profile entity.
-
-
Method Details
-
getUsername
-
setUsername
Sets the unique username.- Parameters:
username- username value
-
getFirstName
-
setFirstName
-
getLastName
-
setLastName
-
getPhone
-
setPhone
-
getGender
-
setGender
-
getProfileImageUrl
-
setProfileImageUrl
Sets the profile image URL.- Parameters:
profileImageUrl- profile image URL
-
getCountry
-
setCountry
-
getState
-
setState
-
getAboutMe
-
setAboutMe
Sets the short biography text.- Parameters:
aboutMe- about-me text
-
getUser
-
setUser
-