Class ThriftReply
java.lang.Object
com.linecorp.armeria.common.thrift.ThriftMessage
com.linecorp.armeria.common.thrift.ThriftReply
public final class ThriftReply extends ThriftMessage
A container of a Thrift reply or exception object (
TBase
or TApplicationException
) and
its header (TMessage
). It is exported to RequestLog.responseContent()
when a Thrift call
is processed.-
Constructor Summary
Constructors Constructor Description ThriftReply(TMessage header, TApplicationException exception)
Creates a new instance that contains a ThriftTMessageType.EXCEPTION
message.ThriftReply(TMessage header, TBase<?,?> result)
Creates a new instance that contains a ThriftTMessageType.REPLY
message. -
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
TApplicationException
exception()
Returns the exception of this reply.int
hashCode()
boolean
isException()
Returnstrue
if the type of this reply isTMessageType.EXCEPTION
.TBase<?,?>
result()
Returns the result of this reply.String
toString()
Methods inherited from class com.linecorp.armeria.common.thrift.ThriftMessage
header
-
Constructor Details
-
ThriftReply
Creates a new instance that contains a ThriftTMessageType.REPLY
message. -
ThriftReply
Creates a new instance that contains a ThriftTMessageType.EXCEPTION
message.
-
-
Method Details
-
isException
public boolean isException()Returnstrue
if the type of this reply isTMessageType.EXCEPTION
. -
result
Returns the result of this reply.- Throws:
IllegalStateException
- if the type of this reply is notTMessageType.REPLY
-
exception
Returns the exception of this reply.- Throws:
IllegalStateException
- if the type of this reply is notTMessageType.EXCEPTION
-
equals
- Overrides:
equals
in classThriftMessage
-
hashCode
public int hashCode()- Overrides:
hashCode
in classThriftMessage
-
toString
-