public class Message extends Object implements Serializable
An Amazon SQS message.
Constructor and Description |
---|
Message()
Default constructor for a new Message object.
|
Modifier and Type | Method and Description |
---|---|
Message |
addAttributesEntry(String key,
String value)
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
Message |
clearAttributesEntries()
Removes all the entries added into Attributes.
|
boolean |
equals(Object obj) |
Map<String,String> |
getAttributes()
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
String |
getBody()
The message's contents (not URL-encoded).
|
String |
getMD5OfBody()
An MD5 digest of the non-URL-encoded message body string.
|
String |
getMessageId()
A unique identifier for the message.
|
String |
getReceiptHandle()
An identifier associated with the act of receiving the message.
|
int |
hashCode() |
void |
setAttributes(Map<String,String> attributes)
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
void |
setBody(String body)
The message's contents (not URL-encoded).
|
void |
setMD5OfBody(String mD5OfBody)
An MD5 digest of the non-URL-encoded message body string.
|
void |
setMessageId(String messageId)
A unique identifier for the message.
|
void |
setReceiptHandle(String receiptHandle)
An identifier associated with the act of receiving the message.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Message |
withAttributes(Map<String,String> attributes)
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
Message |
withBody(String body)
The message's contents (not URL-encoded).
|
Message |
withMD5OfBody(String mD5OfBody)
An MD5 digest of the non-URL-encoded message body string.
|
Message |
withMessageId(String messageId)
A unique identifier for the message.
|
Message |
withReceiptHandle(String receiptHandle)
An identifier associated with the act of receiving the message.
|
public Message()
public String getMessageId()
public void setMessageId(String messageId)
messageId
- A unique identifier for the message. Message IDs are considered unique
across all AWS accounts for an extended period of time.public Message withMessageId(String messageId)
Returns a reference to this object so that method calls can be chained together.
messageId
- A unique identifier for the message. Message IDs are considered unique
across all AWS accounts for an extended period of time.public String getReceiptHandle()
public void setReceiptHandle(String receiptHandle)
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 Message withReceiptHandle(String receiptHandle)
Returns a reference to this object so that method calls can be chained together.
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 String getMD5OfBody()
public void setMD5OfBody(String mD5OfBody)
mD5OfBody
- An MD5 digest of the non-URL-encoded message body string.public Message withMD5OfBody(String mD5OfBody)
Returns a reference to this object so that method calls can be chained together.
mD5OfBody
- An MD5 digest of the non-URL-encoded message body string.public String getBody()
public void setBody(String body)
body
- The message's contents (not URL-encoded).public Message withBody(String body)
Returns a reference to this object so that method calls can be chained together.
body
- The message's contents (not URL-encoded).public Map<String,String> getAttributes()
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.public void setAttributes(Map<String,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 time in
milliseconds.public Message withAttributes(Map<String,String> attributes)
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.
Returns a reference to this object so that method calls can be chained together.
attributes
- SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.public Message addAttributesEntry(String key, String value)
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.
The method adds a new key-value pair into Attributes parameter, and returns a reference to this object so that method calls can be chained together.
key
- The key of the entry to be added into Attributes.value
- The corresponding value of the entry to be added into Attributes.public Message clearAttributesEntries()
Returns a reference to this object so that method calls can be chained together.
public String toString()
toString
in class Object
Object.toString()
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.