Record Class UpdateUserDTO

java.lang.Object
java.lang.Record
com.fiap.tech_challenge.parte1.ms_users.dtos.UpdateUserDTO
Record Components:
name - the user's name (required)
email - the user's email (required and must be valid)
login - the user's login (required)
address - list of addresses (must have at least one and each address is validated)

public record UpdateUserDTO(@NotBlank(message="User field \'name\' is required") String name, @NotBlank(message="User field \'email\' is required") @Email(message="User field \'email\' must be a valid email address") String email, @NotBlank(message="User field \'login\' is required") String login, @Valid @NotEmpty(message="User must have at least one address") List<AddressRequestDTO> address) extends Record
DTO to update user information including addresses.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UpdateUserDTO(@NotBlank(message="User field \'name\' is required") String name, @NotBlank(message="User field \'email\' is required") @Email(message="User field \'email\' must be a valid email address") String email, @NotBlank(message="User field \'login\' is required") String login, @Valid @NotEmpty(message="User must have at least one address") List<AddressRequestDTO> address)
    Creates an instance of a UpdateUserDTO record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Valid @NotEmpty(message="User must have at least one address") List<AddressRequestDTO>
    Returns the value of the address record component.
    @NotBlank(message="User field \'email\' is required") @Email(message="User field \'email\' must be a valid email address") String
    Returns the value of the email record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotBlank(message="User field \'login\' is required") String
    Returns the value of the login record component.
    @NotBlank(message="User field \'name\' is required") String
    Returns the value of the name record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • UpdateUserDTO

      public UpdateUserDTO(@NotBlank(message="User field \'name\' is required") @NotBlank(message="User field \'name\' is required") String name, @NotBlank(message="User field \'email\' is required") @Email(message="User field \'email\' must be a valid email address") @NotBlank(message="User field \'email\' is required") @Email(message="User field \'email\' must be a valid email address") String email, @NotBlank(message="User field \'login\' is required") @NotBlank(message="User field \'login\' is required") String login, @Valid @NotEmpty(message="User must have at least one address") @Valid @NotEmpty(message="User must have at least one address") List<AddressRequestDTO> address)
      Creates an instance of a UpdateUserDTO record class.
      Parameters:
      name - the value for the name record component
      email - the value for the email record component
      login - the value for the login record component
      address - the value for the address 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.
    • name

      @NotBlank(message="User field \'name\' is required") public @NotBlank(message="User field \'name\' is required") String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • email

      @NotBlank(message="User field \'email\' is required") @Email(message="User field \'email\' must be a valid email address") public @NotBlank(message="User field \'email\' is required") @Email(message="User field \'email\' must be a valid email address") String email()
      Returns the value of the email record component.
      Returns:
      the value of the email record component
    • login

      @NotBlank(message="User field \'login\' is required") public @NotBlank(message="User field \'login\' is required") String login()
      Returns the value of the login record component.
      Returns:
      the value of the login record component
    • address

      @Valid @NotEmpty(message="User must have at least one address") public @Valid @NotEmpty(message="User must have at least one address") List<AddressRequestDTO> address()
      Returns the value of the address record component.
      Returns:
      the value of the address record component