Class Message

  • All Implemented Interfaces:
    Recyclable

    public class Message
    extends java.lang.Object
    implements Recyclable
    • Constructor Detail

      • Message

        public Message()
    • Method Detail

      • getQueueName

        @Nullable
        public java.lang.String getQueueName()
      • withQueue

        public Message withQueue​(java.lang.String queueName)
      • getBodyForWrite

        public java.lang.StringBuilder getBodyForWrite()
        Gets a body StringBuilder to write content to. If this message's body is not initializes, this method will initialize from the StringBuilder pool.
        Returns:
        a StringBuilder to write body content to. Never returns null.
      • getBodyForRead

        @Nullable
        public java.lang.StringBuilder getBodyForRead()
        Returns:
        a body if already initialized, null otherwise
      • withBody

        public Message withBody​(@Nullable
                                java.lang.String body)
      • appendToBody

        public Message appendToBody​(java.lang.CharSequence bodyContent)
      • redactBody

        public void redactBody()
      • addHeader

        public Message addHeader​(@Nullable
                                 java.lang.String key,
                                 @Nullable
                                 java.lang.String value)
      • addHeader

        public Message addHeader​(@Nullable
                                 java.lang.String key,
                                 @Nullable
                                 byte[] value)
      • getAge

        public long getAge()
      • withAge

        public Message withAge​(long age)
      • getHeaders

        public Headers getHeaders()
      • hasContent

        public boolean hasContent()
      • resetState

        public void resetState()
        Description copied from interface: Recyclable
        resets pooled object state so it can be reused
        Specified by:
        resetState in interface Recyclable
      • copyFrom

        public void copyFrom​(Message other)