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.Flags
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
PubsubMessage() |
Modifier and Type | Method and Description |
---|---|
PubsubMessage |
clone() |
byte[] |
decodeData()
The message payload.
|
PubsubMessage |
encodeData(byte[] data)
The message payload.
|
String |
getData()
The message payload.
|
List<Label> |
getLabel()
Optional list of labels for this message.
|
String |
getMessageId()
ID of this message assigned by the server at publication time.
|
Long |
getPublishTime()
The time at which the message was published.
|
PubsubMessage |
set(String fieldName,
Object value) |
PubsubMessage |
setData(String data)
The message payload.
|
PubsubMessage |
setLabel(List<Label> label)
Optional list of labels for this message.
|
PubsubMessage |
setMessageId(String messageId)
ID of this message assigned by the server at publication time.
|
PubsubMessage |
setPublishTime(Long publishTime)
The time at which the message was published.
|
getFactory, setFactory, toPrettyString, toString
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
clear, containsKey, containsValue, isEmpty, keySet, size, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public 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 List<Label> getLabel()
null
for nonepublic PubsubMessage setLabel(List<Label> label)
label
- label or null
for nonepublic String getMessageId()
null
for nonepublic PubsubMessage setMessageId(String messageId)
messageId
- messageId or null
for nonepublic Long getPublishTime()
null
for nonepublic PubsubMessage setPublishTime(Long publishTime)
publishTime
- publishTime or null
for nonepublic PubsubMessage set(String fieldName, Object value)
set
in class GenericJson
public PubsubMessage clone()
clone
in class GenericJson
Copyright © 2011–2020 Google. All rights reserved.