Class MessageAccumulator

  • All Implemented Interfaces:

    
    public final class MessageAccumulator
    
                        

    An accumulator that constructs a Message from a sequence of streamed events. Pass all events from the message_start event to the message_stop event to accumulate and then call message to get the final accumulated message. The final Message will be similar to what would have been received had the non-streaming API been used.

    A MessageAccumulator may only be used to accumulate one message. To accumulate another message, create another instance of MessageAccumulator.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • message

         final Message message()

        Gets the final accumulated message. Until the message_stop event has been received, a message will not be available. Wait until all events have been handled by accumulate before calling this method.