public static final class ReceivedMessage.Builder extends Message.Builder
| Modifier and Type | Method and Description |
|---|---|
ReceivedMessage.Builder |
addAttribute(String name,
String value)
Adds a new attribute to the message attributes.
|
ReceivedMessage.Builder |
attributes(Map<String,String> attributes)
Sets the message attributes to the provided map.
|
ReceivedMessage |
build()
Creates a message object.
|
ReceivedMessage.Builder |
clearAttributes()
Clears all message attributes.
|
ReceivedMessage.Builder |
payload(ByteArray payload)
Sets the message payload to the provided
ByteArray. |
ReceivedMessage.Builder |
payload(String payload)
Sets the message payload to the provided string.
|
ReceivedMessage.Builder |
removeAttribute(String name)
Removes an attribute give its name from the message attributes.
|
public ReceivedMessage.Builder payload(String payload)
Message.BuilderUTF-8.payload in class Message.Builderpublic ReceivedMessage.Builder payload(ByteArray payload)
Message.BuilderByteArray.payload in class Message.Builderpublic ReceivedMessage.Builder attributes(Map<String,String> attributes)
Message.Builderiana.org/language_tag and
value en could be added to messages to mark them as readable by an English-speaking
subscriber.attributes in class Message.Builderpublic ReceivedMessage.Builder addAttribute(String name, String value)
Message.Buildername was
already set, its value is updated.addAttribute in class Message.Builderpublic ReceivedMessage.Builder removeAttribute(String name)
Message.BuilderremoveAttribute in class Message.Builderpublic ReceivedMessage.Builder clearAttributes()
Message.BuilderclearAttributes in class Message.Builderpublic ReceivedMessage build()
Message.Builderbuild in class Message.BuilderCopyright © 2016 Google. All rights reserved.