public final class PubsubMessage extends GenericJson
This is the Java data model class that specifies how to parse/serialize into the JSON that is transmitted over HTTP when working with the Cloud Pub/Sub API. For a detailed explanation see: https://developers.google.com/api-client-library/java/google-http-java-client/json
GenericData.FlagsAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
PubsubMessage() |
| Modifier and Type | Method and Description |
|---|---|
PubsubMessage |
clone() |
byte[] |
decodeData()
The message data field.
|
PubsubMessage |
encodeData(byte[] data)
The message data field.
|
Map<String,String> |
getAttributes()
Attributes for this message.
|
String |
getData()
The message data field.
|
String |
getMessageId()
ID of this message, assigned by the server when the message is published.
|
String |
getOrderingKey()
If non-empty, identifies related messages for which publish order should be respected.
|
String |
getPublishTime()
The time at which the message was published, populated by the server when it receives the
`Publish` call.
|
PubsubMessage |
set(String fieldName,
Object value) |
PubsubMessage |
setAttributes(Map<String,String> attributes)
Attributes for this message.
|
PubsubMessage |
setData(String data)
The message data field.
|
PubsubMessage |
setMessageId(String messageId)
ID of this message, assigned by the server when the message is published.
|
PubsubMessage |
setOrderingKey(String orderingKey)
If non-empty, identifies related messages for which publish order should be respected.
|
PubsubMessage |
setPublishTime(String publishTime)
The time at which the message was published, populated by the server when it receives the
`Publish` call.
|
getFactory, setFactory, toPrettyString, toStringentrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeysclear, containsKey, containsValue, isEmpty, keySet, size, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic Map<String,String> getAttributes()
null for nonepublic PubsubMessage setAttributes(Map<String,String> attributes)
attributes - attributes or null for nonepublic String getData()
null for nonedecodeData()public byte[] decodeData()
null for nonegetData()public PubsubMessage setData(String data)
data - data or null for none#encodeData()public PubsubMessage encodeData(byte[] data)
The value is encoded Base64 or {@code null} for none.
public String getMessageId()
null for nonepublic PubsubMessage setMessageId(String messageId)
messageId - messageId or null for nonepublic String getOrderingKey()
null for nonepublic PubsubMessage setOrderingKey(String orderingKey)
orderingKey - orderingKey or null for nonepublic String getPublishTime()
null for nonepublic PubsubMessage setPublishTime(String publishTime)
publishTime - publishTime or null for nonepublic PubsubMessage set(String fieldName, Object value)
set in class GenericJsonpublic PubsubMessage clone()
clone in class GenericJsonCopyright © 2011–2021 Google. All rights reserved.