Class MessageAttributeValue

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class MessageAttributeValue
    extends Object
    implements Serializable, Cloneable

    The user-specified message attribute value. For string data types, the value attribute has the same restrictions on the content as the message body. For more information, see SendMessage.

    Name, type, and value must not be empty or null. In addition, the message body should not be empty or null. All parts of the message attribute, including name, type, and value, are included in the message size restriction, which is currently 256 KB (262,144 bytes).

    See Also:
    Serialized Form
    • Constructor Detail

      • MessageAttributeValue

        public MessageAttributeValue()
    • Method Detail

      • setBinaryValue

        public void setBinaryValue​(ByteBuffer binaryValue)

        Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images.

        AWS SDK for Java performs a Base64 encoding on this field before sending this request to AWS service by default. Users of the SDK should not perform Base64 encoding on this field.

        Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future major version of the SDK.

        Parameters:
        binaryValue - Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images.
      • getBinaryValue

        public ByteBuffer getBinaryValue()

        Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images.

        ByteBuffers are stateful. Calling their get methods changes their position. We recommend using ByteBuffer.asReadOnlyBuffer() to create a read-only view of the buffer with an independent position, and calling get methods on this rather than directly on the returned ByteBuffer. Doing so will ensure that anyone else using the ByteBuffer will not be affected by changes to the position .

        Returns:
        Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images.
      • withBinaryValue

        public MessageAttributeValue withBinaryValue​(ByteBuffer binaryValue)

        Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images.

        Parameters:
        binaryValue - Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • getStringListValues

        public List<String> getStringListValues()

        Not implemented. Reserved for future use.

        Returns:
        Not implemented. Reserved for future use.
      • setStringListValues

        public void setStringListValues​(Collection<String> stringListValues)

        Not implemented. Reserved for future use.

        Parameters:
        stringListValues - Not implemented. Reserved for future use.
      • withStringListValues

        public MessageAttributeValue withStringListValues​(Collection<String> stringListValues)

        Not implemented. Reserved for future use.

        Parameters:
        stringListValues - Not implemented. Reserved for future use.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • getBinaryListValues

        public List<ByteBuffer> getBinaryListValues()

        Not implemented. Reserved for future use.

        Returns:
        Not implemented. Reserved for future use.
      • setBinaryListValues

        public void setBinaryListValues​(Collection<ByteBuffer> binaryListValues)

        Not implemented. Reserved for future use.

        Parameters:
        binaryListValues - Not implemented. Reserved for future use.
      • withBinaryListValues

        public MessageAttributeValue withBinaryListValues​(Collection<ByteBuffer> binaryListValues)

        Not implemented. Reserved for future use.

        Parameters:
        binaryListValues - Not implemented. Reserved for future use.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setDataType

        public void setDataType​(String dataType)

        Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue.

        You can also append custom labels. For more information, see Message Attribute Data Types.

        Parameters:
        dataType - Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue.

        You can also append custom labels. For more information, see Message Attribute Data Types.

      • getDataType

        public String getDataType()

        Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue.

        You can also append custom labels. For more information, see Message Attribute Data Types.

        Returns:
        Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue.

        You can also append custom labels. For more information, see Message Attribute Data Types.

      • withDataType

        public MessageAttributeValue withDataType​(String dataType)

        Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue.

        You can also append custom labels. For more information, see Message Attribute Data Types.

        Parameters:
        dataType - Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue.

        You can also append custom labels. For more information, see Message Attribute Data Types.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • toString

        public String toString()
        Returns a string representation of this object; useful for testing and debugging.
        Overrides:
        toString in class Object
        Returns:
        A string representation of this object.
        See Also:
        Object.toString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object