Package br.com.pawsoncloud.dtos
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
ConstructorsConstructorDescriptionUsuarioDto
(@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 aUsuarioDto
record class. -
Method Summary
Modifier and TypeMethodDescription@NotBlank(message="{cpf.obrigatorio}") @CPF(message="\'${validatedValue}\' \u00e9 inv\u00e1lido!") String
cpf()
Returns the value of thecpf
record component.@NotNull(message="{data.obrigatorio}") @Past(message="Data \'${validatedValue}\' \u00e9 inv\u00e1lida!") LocalDate
Returns the value of thedataNascimento
record component.@NotBlank(message="{email.obrigatorio}") @Email(message="{email.invalido}") String
email()
Returns the value of theemail
record component.@Valid EnderecoDto
endereco()
Returns the value of theendereco
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.@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 thenome
record component.@NotBlank(message="{senha.obrigatorio}") String
senha()
Returns the value of thesenha
record component.@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 thetelefone
record component.final String
toString()
Returns a string representation of this record class.
-
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 aUsuarioDto
record class.- Parameters:
nome
- the value for thenome
record componentemail
- the value for theemail
record componentsenha
- the value for thesenha
record componentdataNascimento
- the value for thedataNascimento
record componentcpf
- the value for thecpf
record componenttelefone
- the value for thetelefone
record componentendereco
- the value for theendereco
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)
. -
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 thenome
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 theemail
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 thesenha
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 thedataNascimento
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 thecpf
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 thetelefone
record component.- Returns:
- the value of the
telefone
record component
-
endereco
Returns the value of theendereco
record component.- Returns:
- the value of the
endereco
record component
-