Record Class ApiResponse
java.lang.Object
java.lang.Record
br.com.selfmaintenance.utils.responses.ApiResponse
public record ApiResponse(int status, String mensagem, Object dados, DadosErroResponse erro)
extends Record
[ApiResponse] é a classe que representa a resposta padrão da API.
- Version:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionApiResponse(int status, String mensagem) ApiResponse(int status, String mensagem, DadosErroResponse erro) ApiResponse(int status, String mensagem, Object dados) ApiResponse(int status, String mensagem, Object dados, DadosErroResponse erro) Creates an instance of aApiResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptiondados()Returns the value of thedadosrecord component.final booleanIndicates whether some other object is "equal to" this one.erro()Returns the value of theerrorecord component.final inthashCode()Returns a hash code value for this object.mensagem()Returns the value of themensagemrecord component.intstatus()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ApiResponse
-
ApiResponse
-
ApiResponse
-
ApiResponse
Creates an instance of aApiResponserecord class.- Parameters:
status- the value for thestatusrecord componentmensagem- the value for themensagemrecord componentdados- the value for thedadosrecord componenterro- the value for theerrorecord 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 '=='. -
status
public int status()Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
mensagem
Returns the value of themensagemrecord component.- Returns:
- the value of the
mensagemrecord component
-
dados
Returns the value of thedadosrecord component.- Returns:
- the value of the
dadosrecord component
-
erro
Returns the value of theerrorecord component.- Returns:
- the value of the
errorecord component
-