Package br.com.pawsoncloud.dtos
Record Class EnderecoRespDto
java.lang.Object
java.lang.Record
br.com.pawsoncloud.dtos.EnderecoRespDto
Representa um objeto de transferência de dados (DTO) para informações completas de endereço.
Este DTO é usado para fornecer uma versão simplificada de um endereço para a resposta da API.
Retorna apenas a cidade e o estado.
- Author:
- Edielson Assis
-
Constructor Summary
ConstructorsConstructorDescriptionEnderecoRespDto
(Endereco endereco) Construtor que converte uma instância de Endereco para EnderecoRespDto.EnderecoRespDto
(String cidade, String estado) Creates an instance of aEnderecoRespDto
record class. -
Method Summary
Modifier and TypeMethodDescriptioncidade()
Returns the value of thecidade
record component.final boolean
Indicates whether some other object is "equal to" this one.estado()
Returns the value of theestado
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
EnderecoRespDto
Construtor que converte uma instância de Endereco para EnderecoRespDto.- Parameters:
endereco
- A instância de Endereco a ser convertida.
-
EnderecoRespDto
Creates an instance of aEnderecoRespDto
record class.- Parameters:
cidade
- the value for thecidade
record componentestado
- the value for theestado
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)
. -
cidade
Returns the value of thecidade
record component.- Returns:
- the value of the
cidade
record component
-
estado
Returns the value of theestado
record component.- Returns:
- the value of the
estado
record component
-