Record Class ViewUserDto
java.lang.Object
java.lang.Record
dev.fernando.user_authentication_api.dto.ViewUserDto
- Record Components:
id- the user IDusername- the user's nameemail- the user's emailphone- the user's phone numberbirthdayDate- the user's birthday datecpf- the user's CPF (Brazilian ID)userRole- the user's role
public record ViewUserDto(Long id, String username, String email, String phone, Date birthdayDate, String cpf, UserRole userRole)
extends Record
Data Transfer Object for viewing user details.
Contains user information to be sent in API responses.
- Since:
- 1.0.0
- Author:
- Fernando Cruz Cavina
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebirthdayDaterecord component.cpf()Returns the value of thecpfrecord component.email()Returns the value of theemailrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.phone()Returns the value of thephonerecord component.final StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.userRole()Returns the value of theuserRolerecord component.
-
Constructor Details
-
ViewUserDto
public ViewUserDto(Long id, String username, String email, String phone, Date birthdayDate, String cpf, UserRole userRole) Creates an instance of aViewUserDtorecord class.- Parameters:
id- the value for theidrecord componentusername- the value for theusernamerecord componentemail- the value for theemailrecord componentphone- the value for thephonerecord componentbirthdayDate- the value for thebirthdayDaterecord componentcpf- the value for thecpfrecord componentuserRole- the value for theuserRolerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-
phone
Returns the value of thephonerecord component.- Returns:
- the value of the
phonerecord component
-
birthdayDate
Returns the value of thebirthdayDaterecord component.- Returns:
- the value of the
birthdayDaterecord component
-
cpf
Returns the value of thecpfrecord component.- Returns:
- the value of the
cpfrecord component
-
userRole
Returns the value of theuserRolerecord component.- Returns:
- the value of the
userRolerecord component
-