Record Class ViewUserDto

java.lang.Object
java.lang.Record
dev.fernando.user_authentication_api.dto.ViewUserDto
Record Components:
id - the user ID
username - the user's name
email - the user's email
phone - the user's phone number
birthdayDate - the user's birthday date
cpf - 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 Details

    • ViewUserDto

      public ViewUserDto(Long id, String username, String email, String phone, Date birthdayDate, String cpf, UserRole userRole)
      Creates an instance of a ViewUserDto record class.
      Parameters:
      id - the value for the id record component
      username - the value for the username record component
      email - the value for the email record component
      phone - the value for the phone record component
      birthdayDate - the value for the birthdayDate record component
      cpf - the value for the cpf record component
      userRole - the value for the userRole record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public Long id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • username

      public String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • email

      public String email()
      Returns the value of the email record component.
      Returns:
      the value of the email record component
    • phone

      public String phone()
      Returns the value of the phone record component.
      Returns:
      the value of the phone record component
    • birthdayDate

      public Date birthdayDate()
      Returns the value of the birthdayDate record component.
      Returns:
      the value of the birthdayDate record component
    • cpf

      public String cpf()
      Returns the value of the cpf record component.
      Returns:
      the value of the cpf record component
    • userRole

      public UserRole userRole()
      Returns the value of the userRole record component.
      Returns:
      the value of the userRole record component