public class Message
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
An Amazon SQS message.
Modifier and Type | Field and Description |
---|---|
private SdkInternalMap<java.lang.String,java.lang.String> |
attributes
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
private java.lang.String |
body
The message's contents (not URL-encoded).
|
private java.lang.String |
mD5OfBody
An MD5 digest of the non-URL-encoded message body string.
|
private java.lang.String |
mD5OfMessageAttributes
An MD5 digest of the non-URL-encoded message attribute string.
|
private SdkInternalMap<java.lang.String,MessageAttributeValue> |
messageAttributes
Each message attribute consists of a Name, Type, and Value.
|
private java.lang.String |
messageId
A unique identifier for the message.
|
private java.lang.String |
receiptHandle
An identifier associated with the act of receiving the message.
|
Constructor and Description |
---|
Message() |
Modifier and Type | Method and Description |
---|---|
Message |
addAttributesEntry(java.lang.String key,
java.lang.String value) |
Message |
addMessageAttributesEntry(java.lang.String key,
MessageAttributeValue value) |
Message |
clearAttributesEntries()
Removes all the entries added into Attributes.
|
Message |
clearMessageAttributesEntries()
Removes all the entries added into MessageAttributes.
|
Message |
clone() |
boolean |
equals(java.lang.Object obj) |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
java.lang.String |
getBody()
The message's contents (not URL-encoded).
|
java.lang.String |
getMD5OfBody()
An MD5 digest of the non-URL-encoded message body string.
|
java.lang.String |
getMD5OfMessageAttributes()
An MD5 digest of the non-URL-encoded message attribute string.
|
java.util.Map<java.lang.String,MessageAttributeValue> |
getMessageAttributes()
Each message attribute consists of a Name, Type, and Value.
|
java.lang.String |
getMessageId()
A unique identifier for the message.
|
java.lang.String |
getReceiptHandle()
An identifier associated with the act of receiving the message.
|
int |
hashCode() |
void |
setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
void |
setBody(java.lang.String body)
The message's contents (not URL-encoded).
|
void |
setMD5OfBody(java.lang.String mD5OfBody)
An MD5 digest of the non-URL-encoded message body string.
|
void |
setMD5OfMessageAttributes(java.lang.String mD5OfMessageAttributes)
An MD5 digest of the non-URL-encoded message attribute string.
|
void |
setMessageAttributes(java.util.Map<java.lang.String,MessageAttributeValue> messageAttributes)
Each message attribute consists of a Name, Type, and Value.
|
void |
setMessageId(java.lang.String messageId)
A unique identifier for the message.
|
void |
setReceiptHandle(java.lang.String receiptHandle)
An identifier associated with the act of receiving the message.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Message |
withAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
Message |
withBody(java.lang.String body)
The message's contents (not URL-encoded).
|
Message |
withMD5OfBody(java.lang.String mD5OfBody)
An MD5 digest of the non-URL-encoded message body string.
|
Message |
withMD5OfMessageAttributes(java.lang.String mD5OfMessageAttributes)
An MD5 digest of the non-URL-encoded message attribute string.
|
Message |
withMessageAttributes(java.util.Map<java.lang.String,MessageAttributeValue> messageAttributes)
Each message attribute consists of a Name, Type, and Value.
|
Message |
withMessageId(java.lang.String messageId)
A unique identifier for the message.
|
Message |
withReceiptHandle(java.lang.String receiptHandle)
An identifier associated with the act of receiving the message.
|
private java.lang.String messageId
A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
private java.lang.String receiptHandle
An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
private java.lang.String mD5OfBody
An MD5 digest of the non-URL-encoded message body string.
private java.lang.String body
The message's contents (not URL-encoded).
private SdkInternalMap<java.lang.String,java.lang.String> attributes
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
. SentTimestamp
and ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.
private java.lang.String mD5OfMessageAttributes
An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
private SdkInternalMap<java.lang.String,MessageAttributeValue> messageAttributes
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
public void setMessageId(java.lang.String messageId)
A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
messageId
- A unique identifier for the message. Message IDs are considered
unique across all AWS accounts for an extended period of time.public java.lang.String getMessageId()
A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
public Message withMessageId(java.lang.String messageId)
A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
messageId
- A unique identifier for the message. Message IDs are considered
unique across all AWS accounts for an extended period of time.public void setReceiptHandle(java.lang.String receiptHandle)
An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
receiptHandle
- An identifier associated with the act of receiving the message. A
new receipt handle is returned every time you receive a message.
When deleting a message, you provide the last received receipt
handle to delete the message.public java.lang.String getReceiptHandle()
An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
public Message withReceiptHandle(java.lang.String receiptHandle)
An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
receiptHandle
- An identifier associated with the act of receiving the message. A
new receipt handle is returned every time you receive a message.
When deleting a message, you provide the last received receipt
handle to delete the message.public void setMD5OfBody(java.lang.String mD5OfBody)
An MD5 digest of the non-URL-encoded message body string.
mD5OfBody
- An MD5 digest of the non-URL-encoded message body string.public java.lang.String getMD5OfBody()
An MD5 digest of the non-URL-encoded message body string.
public Message withMD5OfBody(java.lang.String mD5OfBody)
An MD5 digest of the non-URL-encoded message body string.
mD5OfBody
- An MD5 digest of the non-URL-encoded message body string.public void setBody(java.lang.String body)
The message's contents (not URL-encoded).
body
- The message's contents (not URL-encoded).public java.lang.String getBody()
The message's contents (not URL-encoded).
public Message withBody(java.lang.String body)
The message's contents (not URL-encoded).
body
- The message's contents (not URL-encoded).public java.util.Map<java.lang.String,java.lang.String> getAttributes()
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
. SentTimestamp
and ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.
SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned
as an integer representing the epoch timepublic void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
. SentTimestamp
and ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.
attributes
- SenderId, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as
an integer representing the epoch timepublic Message withAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
. SentTimestamp
and ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.
attributes
- SenderId, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as
an integer representing the epoch timepublic Message addAttributesEntry(java.lang.String key, java.lang.String value)
public Message clearAttributesEntries()
public void setMD5OfMessageAttributes(java.lang.String mD5OfMessageAttributes)
An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
mD5OfMessageAttributes
- An MD5 digest of the non-URL-encoded message attribute string.
This can be used to verify that Amazon SQS received the message
correctly. Amazon SQS first URL decodes the message before
creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.public java.lang.String getMD5OfMessageAttributes()
An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
public Message withMD5OfMessageAttributes(java.lang.String mD5OfMessageAttributes)
An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
mD5OfMessageAttributes
- An MD5 digest of the non-URL-encoded message attribute string.
This can be used to verify that Amazon SQS received the message
correctly. Amazon SQS first URL decodes the message before
creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.public java.util.Map<java.lang.String,MessageAttributeValue> getMessageAttributes()
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
public void setMessageAttributes(java.util.Map<java.lang.String,MessageAttributeValue> messageAttributes)
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
messageAttributes
- Each message attribute consists of a Name, Type, and Value. For
more information, see Message Attribute Items.public Message withMessageAttributes(java.util.Map<java.lang.String,MessageAttributeValue> messageAttributes)
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
messageAttributes
- Each message attribute consists of a Name, Type, and Value. For
more information, see Message Attribute Items.public Message addMessageAttributesEntry(java.lang.String key, MessageAttributeValue value)
public Message clearMessageAttributesEntries()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Message clone()
clone
in class java.lang.Object