Record Class UsuarioDto

java.lang.Object
java.lang.Record
br.com.pawsoncloud.dtos.UsuarioDto

public record UsuarioDto(@NotBlank(message="{nome.obrigatorio}") @Pattern(regexp="^[a-zA-Z\u00c0-\u00ff\\s]+$",message="{campo.letras}") @Size(min=3,message="\'${validatedValue}\' precisa ter, pelo menos, {min} caracteres.") String nome, @NotBlank(message="{email.obrigatorio}") @Email(message="{email.invalido}") String email, @NotBlank(message="{senha.obrigatorio}") String senha, @NotNull(message="{data.obrigatorio}") @Past(message="Data \'${validatedValue}\' \u00e9 inv\u00e1lida!") LocalDate dataNascimento, @NotBlank(message="{cpf.obrigatorio}") @CPF(message="\'${validatedValue}\' \u00e9 inv\u00e1lido!") String cpf, @NotBlank(message="{telefone.obrigatorio}") @Pattern(regexp="^(\\+\\d{1,2}\\s?)?(\\(\\d{2}\\)\\s?)?(\\d{4,5}-?\\d{4})$",message="{campo.numeros}") String telefone, @Valid EnderecoDto endereco) extends Record
Representa um objeto de transferência de dados (DTO) para informações de usuário. Este DTO é usado para validar e transportar dados de usuário para a API.
Author:
Edielson Assis
  • Constructor Summary

    Constructors
    Constructor
    Description
    UsuarioDto(@NotBlank(message="{nome.obrigatorio}") @Pattern(regexp="^[a-zA-Z\u00c0-\u00ff\\s]+$",message="{campo.letras}") @Size(min=3,message="\'${validatedValue}\' precisa ter, pelo menos, {min} caracteres.") String nome, @NotBlank(message="{email.obrigatorio}") @Email(message="{email.invalido}") String email, @NotBlank(message="{senha.obrigatorio}") String senha, @NotNull(message="{data.obrigatorio}") @Past(message="Data \'${validatedValue}\' \u00e9 inv\u00e1lida!") LocalDate dataNascimento, @NotBlank(message="{cpf.obrigatorio}") @CPF(message="\'${validatedValue}\' \u00e9 inv\u00e1lido!") String cpf, @NotBlank(message="{telefone.obrigatorio}") @Pattern(regexp="^(\\+\\d{1,2}\\s?)?(\\(\\d{2}\\)\\s?)?(\\d{4,5}-?\\d{4})$",message="{campo.numeros}") String telefone, @Valid EnderecoDto endereco)
    Creates an instance of a UsuarioDto record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotBlank(message="{cpf.obrigatorio}") @CPF(message="\'${validatedValue}\' \u00e9 inv\u00e1lido!") String
    cpf()
    Returns the value of the cpf record component.
    @NotNull(message="{data.obrigatorio}") @Past(message="Data \'${validatedValue}\' \u00e9 inv\u00e1lida!") LocalDate
    Returns the value of the dataNascimento record component.
    @NotBlank(message="{email.obrigatorio}") @Email(message="{email.invalido}") String
    Returns the value of the email record component.
    Returns the value of the endereco 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="{nome.obrigatorio}") @Pattern(regexp="^[a-zA-Z\u00c0-\u00ff\\s]+$",message="{campo.letras}") @Size(min=3,message="\'${validatedValue}\' precisa ter, pelo menos, {min} caracteres.") String
    Returns the value of the nome record component.
    @NotBlank(message="{senha.obrigatorio}") String
    Returns the value of the senha record component.
    @NotBlank(message="{telefone.obrigatorio}") @Pattern(regexp="^(\\+\\d{1,2}\\s?)?(\\(\\d{2}\\)\\s?)?(\\d{4,5}-?\\d{4})$",message="{campo.numeros}") String
    Returns the value of the telefone 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

    • UsuarioDto

      public UsuarioDto(@NotBlank(message="{nome.obrigatorio}") @Pattern(regexp="^[a-zA-Z\u00c0-\u00ff\\s]+$",message="{campo.letras}") @Size(min=3,message="\'${validatedValue}\' precisa ter, pelo menos, {min} caracteres.") @NotBlank(message="{nome.obrigatorio}") @Pattern(regexp="^[a-zA-Z\u00c0-\u00ff\\s]+$",message="{campo.letras}") @Size(min=3,message="\'${validatedValue}\' precisa ter, pelo menos, {min} caracteres.") String nome, @NotBlank(message="{email.obrigatorio}") @Email(message="{email.invalido}") @NotBlank(message="{email.obrigatorio}") @Email(message="{email.invalido}") String email, @NotBlank(message="{senha.obrigatorio}") @NotBlank(message="{senha.obrigatorio}") String senha, @NotNull(message="{data.obrigatorio}") @Past(message="Data \'${validatedValue}\' \u00e9 inv\u00e1lida!") @NotNull(message="{data.obrigatorio}") @Past(message="Data \'${validatedValue}\' \u00e9 inv\u00e1lida!") LocalDate dataNascimento, @NotBlank(message="{cpf.obrigatorio}") @CPF(message="\'${validatedValue}\' \u00e9 inv\u00e1lido!") @NotBlank(message="{cpf.obrigatorio}") @CPF(message="\'${validatedValue}\' \u00e9 inv\u00e1lido!") String cpf, @NotBlank(message="{telefone.obrigatorio}") @Pattern(regexp="^(\\+\\d{1,2}\\s?)?(\\(\\d{2}\\)\\s?)?(\\d{4,5}-?\\d{4})$",message="{campo.numeros}") @NotBlank(message="{telefone.obrigatorio}") @Pattern(regexp="^(\\+\\d{1,2}\\s?)?(\\(\\d{2}\\)\\s?)?(\\d{4,5}-?\\d{4})$",message="{campo.numeros}") String telefone, @Valid @Valid EnderecoDto endereco)
      Creates an instance of a UsuarioDto record class.
      Parameters:
      nome - the value for the nome record component
      email - the value for the email record component
      senha - the value for the senha record component
      dataNascimento - the value for the dataNascimento record component
      cpf - the value for the cpf record component
      telefone - the value for the telefone record component
      endereco - the value for the endereco 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.
    • nome

      @NotBlank(message="{nome.obrigatorio}") @Pattern(regexp="^[a-zA-Z\u00c0-\u00ff\\s]+$", message="{campo.letras}") @Size(min=3, message="\'${validatedValue}\' precisa ter, pelo menos, {min} caracteres.") public @NotBlank(message="{nome.obrigatorio}") @Pattern(regexp="^[a-zA-Z\u00c0-\u00ff\\s]+$",message="{campo.letras}") @Size(min=3,message="\'${validatedValue}\' precisa ter, pelo menos, {min} caracteres.") String nome()
      Returns the value of the nome record component.
      Returns:
      the value of the nome record component
    • email

      @NotBlank(message="{email.obrigatorio}") @Email(message="{email.invalido}") public @NotBlank(message="{email.obrigatorio}") @Email(message="{email.invalido}") String email()
      Returns the value of the email record component.
      Returns:
      the value of the email record component
    • senha

      @NotBlank(message="{senha.obrigatorio}") public @NotBlank(message="{senha.obrigatorio}") String senha()
      Returns the value of the senha record component.
      Returns:
      the value of the senha record component
    • dataNascimento

      @NotNull(message="{data.obrigatorio}") @Past(message="Data \'${validatedValue}\' \u00e9 inv\u00e1lida!") public @NotNull(message="{data.obrigatorio}") @Past(message="Data \'${validatedValue}\' \u00e9 inv\u00e1lida!") LocalDate dataNascimento()
      Returns the value of the dataNascimento record component.
      Returns:
      the value of the dataNascimento record component
    • cpf

      @NotBlank(message="{cpf.obrigatorio}") @CPF(message="\'${validatedValue}\' \u00e9 inv\u00e1lido!") public @NotBlank(message="{cpf.obrigatorio}") @CPF(message="\'${validatedValue}\' \u00e9 inv\u00e1lido!") String cpf()
      Returns the value of the cpf record component.
      Returns:
      the value of the cpf record component
    • telefone

      @NotBlank(message="{telefone.obrigatorio}") @Pattern(regexp="^(\\+\\d{1,2}\\s?)?(\\(\\d{2}\\)\\s?)?(\\d{4,5}-?\\d{4})$", message="{campo.numeros}") public @NotBlank(message="{telefone.obrigatorio}") @Pattern(regexp="^(\\+\\d{1,2}\\s?)?(\\(\\d{2}\\)\\s?)?(\\d{4,5}-?\\d{4})$",message="{campo.numeros}") String telefone()
      Returns the value of the telefone record component.
      Returns:
      the value of the telefone record component
    • endereco

      @Valid public @Valid EnderecoDto endereco()
      Returns the value of the endereco record component.
      Returns:
      the value of the endereco record component