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(org.apache.thrift.protocol.TMessage header, org.apache.thrift.TApplicationException exception)
    Creates a new instance that contains a Thrift TMessageType.EXCEPTION message.
    ThriftReply(org.apache.thrift.protocol.TMessage header, org.apache.thrift.TBase<?,?> result)
    Creates a new instance that contains a Thrift TMessageType.REPLY message.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    org.apache.thrift.TApplicationException
    Returns the exception of this reply.
    int
     
    boolean
    Returns true if the type of this reply is TMessageType.EXCEPTION.
    org.apache.thrift.TBase<?,?>
    Returns the result of this reply.
     

    Methods inherited from class com.linecorp.armeria.common.thrift.ThriftMessage

    header

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ThriftReply

      public ThriftReply(org.apache.thrift.protocol.TMessage header, org.apache.thrift.TBase<?,?> result)
      Creates a new instance that contains a Thrift TMessageType.REPLY message.
    • ThriftReply

      public ThriftReply(org.apache.thrift.protocol.TMessage header, org.apache.thrift.TApplicationException exception)
      Creates a new instance that contains a Thrift TMessageType.EXCEPTION message.
  • Method Details

    • isException

      public boolean isException()
      Returns true if the type of this reply is TMessageType.EXCEPTION.
    • result

      public org.apache.thrift.TBase<?,?> result()
      Returns the result of this reply.
      Throws:
      IllegalStateException - if the type of this reply is not TMessageType.REPLY
    • exception

      public org.apache.thrift.TApplicationException exception()
      Returns the exception of this reply.
      Throws:
      IllegalStateException - if the type of this reply is not TMessageType.EXCEPTION
    • equals

      public boolean equals(@Nullable @Nullable Object o)
      Overrides:
      equals in class ThriftMessage
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ThriftMessage
    • toString

      public String toString()
      Overrides:
      toString in class Object