public class Message
extends java.lang.Object
implements java.io.Serializable
An Amazon SQS message.
Constructor and Description |
---|
Message() |
Modifier and Type | Method and Description |
---|---|
Message |
addAttributesEntry(java.lang.String key,
java.lang.String value)
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
Message |
addMessageAttributesEntry(java.lang.String key,
MessageAttributeValue value)
Each message attribute consists of a Name, Type, and Value.
|
Message |
clearAttributesEntries()
Removes all the entries added into Attributes.
|
Message |
clearMessageAttributesEntries()
Removes all the entries added into MessageAttributes.
|
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.
|
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.
A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
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 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.
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 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.
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 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 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.
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 java.lang.String getMD5OfBody()
An MD5 digest of the non-URL-encoded message body string.
An MD5 digest of the non-URL-encoded message body string.
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 Message withMD5OfBody(java.lang.String mD5OfBody)
An MD5 digest of the non-URL-encoded message body string.
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 java.lang.String getBody()
The message's contents (not URL-encoded).
The message's contents (not URL-encoded).
public void setBody(java.lang.String body)
The message's contents (not URL-encoded).
body
- The message's contents (not URL-encoded).
public Message withBody(java.lang.String body)
The message's contents (not URL-encoded).
Returns a reference to this object so that method calls can be chained together.
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.
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned
as an integer representing the epoch time in
milliseconds.
public 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 time
in milliseconds.
public 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.
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(java.lang.String key, java.lang.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 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, see RFC1321.
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, see RFC1321.
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, see RFC1321.
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, see RFC1321.
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, see RFC1321.
Returns a reference to this object so that method calls can be chained together.
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, see RFC1321.
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 in the Amazon SQS Developer Guide.
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items in the Amazon SQS Developer Guide.
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 in the Amazon SQS Developer Guide.
messageAttributes
- Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items in the Amazon SQS Developer Guide.
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 in the Amazon SQS Developer Guide.
Returns a reference to this object so that method calls can be chained together.
messageAttributes
- Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items in the Amazon SQS Developer Guide.
public Message addMessageAttributesEntry(java.lang.String key, MessageAttributeValue value)
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items in the Amazon SQS Developer Guide.
The method adds a new key-value pair into MessageAttributes 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 MessageAttributes.value
- The corresponding value of the entry to be added into
MessageAttributes.public Message clearMessageAttributesEntries()
Returns a reference to this object so that method calls can be chained together.
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.