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 thebirthdayDate
record component.cpf()
Returns the value of thecpf
record component.email()
Returns the value of theemail
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.phone()
Returns the value of thephone
record component.final String
toString()
Returns a string representation of this record class.username()
Returns the value of theusername
record component.userRole()
Returns the value of theuserRole
record component.
-
Constructor Details
-
ViewUserDto
public ViewUserDto(Long id, String username, String email, String phone, Date birthdayDate, String cpf, UserRole userRole) Creates an instance of aViewUserDto
record class.- Parameters:
id
- the value for theid
record componentusername
- the value for theusername
record componentemail
- the value for theemail
record componentphone
- the value for thephone
record componentbirthdayDate
- the value for thebirthdayDate
record componentcpf
- the value for thecpf
record componentuserRole
- the value for theuserRole
record 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 theid
record component.- Returns:
- the value of the
id
record component
-
username
Returns the value of theusername
record component.- Returns:
- the value of the
username
record component
-
email
Returns the value of theemail
record component.- Returns:
- the value of the
email
record component
-
phone
Returns the value of thephone
record component.- Returns:
- the value of the
phone
record component
-
birthdayDate
Returns the value of thebirthdayDate
record component.- Returns:
- the value of the
birthdayDate
record component
-
cpf
Returns the value of thecpf
record component.- Returns:
- the value of the
cpf
record component
-
userRole
Returns the value of theuserRole
record component.- Returns:
- the value of the
userRole
record component
-