Record Class ResultadoEnvio
java.lang.Object
java.lang.Record
br.com.xadm.comum.mensageria.ResultadoEnvio
- Record Components:
ok- true se o destino aceitou (o relay marcaENVIADO).statusHttp- status HTTP da resposta;0é a sentinela "sem resposta" (destino offline/timeout — o caso-alvo do outbox), renderizada como "sem resposta".corpoResumo- trecho saneado do corpo/erro para a tela (NUNCA segredo/token/Authorization).
Resultado de uma tentativa de envio, devolvido pelo
EnviadorMensagem.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSentinela de "sem resposta HTTP" (conexão recusada, timeout, destino offline). -
Constructor Summary
ConstructorsConstructorDescriptionResultadoEnvio(boolean ok, int statusHttp, String corpoResumo) Creates an instance of aResultadoEnviorecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecorpoResumorecord component.final booleanIndicates whether some other object is "equal to" this one.static ResultadoEnvioFalha com resposta HTTP (ex.: 500).final inthashCode()Returns a hash code value for this object.booleanok()Returns the value of theokrecord component.static ResultadoEnvioSucesso conveniente.static ResultadoEnviosemResposta(String corpoResumo) Falha sem resposta (offline/timeout):statusHttp = SEM_RESPOSTA.intReturns the value of thestatusHttprecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
SEM_RESPOSTA
public static final int SEM_RESPOSTASentinela de "sem resposta HTTP" (conexão recusada, timeout, destino offline).- See Also:
-
-
Constructor Details
-
ResultadoEnvio
Creates an instance of aResultadoEnviorecord class.- Parameters:
ok- the value for theokrecord componentstatusHttp- the value for thestatusHttprecord componentcorpoResumo- the value for thecorpoResumorecord component
-
-
Method Details
-
ok
Sucesso conveniente. -
falha
Falha com resposta HTTP (ex.: 500). -
semResposta
Falha sem resposta (offline/timeout):statusHttp = SEM_RESPOSTA. -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
ok
-
statusHttp
public int statusHttp()Returns the value of thestatusHttprecord component.- Returns:
- the value of the
statusHttprecord component
-
corpoResumo
Returns the value of thecorpoResumorecord component.- Returns:
- the value of the
corpoResumorecord component
-