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 (TBaseorTApplicationException) and its header (TMessage). It is exported toRequestLog.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.EXCEPTIONmessage.ThriftReply(TMessage header, TBase<?,?> result)Creates a new instance that contains a ThriftTMessageType.REPLYmessage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)TApplicationExceptionexception()Returns the exception of this reply.inthashCode()booleanisException()Returnstrueif the type of this reply isTMessageType.EXCEPTION.TBase<?,?>result()Returns the result of this reply.StringtoString()-
Methods inherited from class com.linecorp.armeria.common.thrift.ThriftMessage
header
-
-
-
-
Constructor Detail
-
ThriftReply
public ThriftReply(TMessage header, TBase<?,?> result)
Creates a new instance that contains a ThriftTMessageType.REPLYmessage.
-
ThriftReply
public ThriftReply(TMessage header, TApplicationException exception)
Creates a new instance that contains a ThriftTMessageType.EXCEPTIONmessage.
-
-
Method Detail
-
isException
public boolean isException()
Returnstrueif the type of this reply isTMessageType.EXCEPTION.
-
result
public TBase<?,?> result()
Returns the result of this reply.- Throws:
IllegalStateException- if the type of this reply is notTMessageType.REPLY
-
exception
public TApplicationException exception()
Returns the exception of this reply.- Throws:
IllegalStateException- if the type of this reply is notTMessageType.EXCEPTION
-
equals
public boolean equals(@Nullable Object o)- Overrides:
equalsin classThriftMessage
-
hashCode
public int hashCode()
- Overrides:
hashCodein classThriftMessage
-
-