Package br.com.pawsoncloud.dtos
Record Class AdocaoRespDto
java.lang.Object
java.lang.Record
br.com.pawsoncloud.dtos.AdocaoRespDto
public record AdocaoRespDto(Long id, Long petId, UsuarioResponseDto adotante, boolean confirmarAdocao)
extends Record
Representa um objeto de transferência de dados (DTO) para informações de adoção.
Este DTO é usado para fornecer uma versão simplificada de uma adoção para a resposta da API.
- Author:
- Edielson Assis
-
Constructor Summary
ConstructorsConstructorDescriptionAdocaoRespDto
(Adocao adocao) Construtor que converte uma instância de Adocao para AdocaoRespDto.AdocaoRespDto
(Long id, Long petId, UsuarioResponseDto adotante, boolean confirmarAdocao) Creates an instance of aAdocaoRespDto
record class. -
Method Summary
Modifier and TypeMethodDescriptionadotante()
Returns the value of theadotante
record component.boolean
Returns the value of theconfirmarAdocao
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.id()
Returns the value of theid
record component.petId()
Returns the value of thepetId
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
AdocaoRespDto
Construtor que converte uma instância de Adocao para AdocaoRespDto.- Parameters:
adocao
- A instância de Adocao a ser convertida.
-
AdocaoRespDto
Creates an instance of aAdocaoRespDto
record class.- Parameters:
id
- the value for theid
record componentpetId
- the value for thepetId
record componentadotante
- the value for theadotante
record componentconfirmarAdocao
- the value for theconfirmarAdocao
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
petId
Returns the value of thepetId
record component.- Returns:
- the value of the
petId
record component
-
adotante
Returns the value of theadotante
record component.- Returns:
- the value of the
adotante
record component
-
confirmarAdocao
public boolean confirmarAdocao()Returns the value of theconfirmarAdocao
record component.- Returns:
- the value of the
confirmarAdocao
record component
-