public final class PubsubMessage extends GeneratedMessage implements PubsubMessageOrBuilder
google.pubsub.v1.PubsubMessage
A message data and its attributes. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute.
| Modifier and Type | Class and Description |
|---|---|
static class |
PubsubMessage.Builder
Protobuf type
google.pubsub.v1.PubsubMessage |
GeneratedMessage.ExtendableBuilder<MessageType extends GeneratedMessage.ExtendableMessage,BuilderType extends GeneratedMessage.ExtendableBuilder>, GeneratedMessage.ExtendableMessage<MessageType extends GeneratedMessage.ExtendableMessage>, GeneratedMessage.ExtendableMessageOrBuilder<MessageType extends GeneratedMessage.ExtendableMessage>, GeneratedMessage.FieldAccessorTable, GeneratedMessage.GeneratedExtension<ContainingType extends Message,Type>| Modifier and Type | Field and Description |
|---|---|
static int |
ATTRIBUTES_FIELD_NUMBER |
static int |
DATA_FIELD_NUMBER |
static int |
MESSAGE_ID_FIELD_NUMBER |
static int |
PUBLISH_TIME_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Optional attributes for this message.
|
ByteString |
getData()
The message payload.
|
static PubsubMessage |
getDefaultInstance() |
PubsubMessage |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
static Descriptors.Descriptor |
getDescriptor() |
java.lang.String |
getMessageId()
ID of this message, assigned by the server when the message is published.
|
ByteString |
getMessageIdBytes()
ID of this message, assigned by the server when the message is published.
|
Parser<PubsubMessage> |
getParserForType()
Gets the parser for a message of the same type as this message.
|
Timestamp |
getPublishTime()
The time at which the message was published, populated by the server when
it receives the `Publish` call.
|
TimestampOrBuilder |
getPublishTimeOrBuilder()
The time at which the message was published, populated by the server when
it receives the `Publish` call.
|
int |
getSerializedSize()
Get the number of bytes required to encode this message.
|
UnknownFieldSet |
getUnknownFields()
Get the
UnknownFieldSet for this message. |
boolean |
hasPublishTime()
The time at which the message was published, populated by the server when
it receives the `Publish` call.
|
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded
messages are set, false otherwise.
|
static PubsubMessage.Builder |
newBuilder() |
static PubsubMessage.Builder |
newBuilder(PubsubMessage prototype) |
PubsubMessage.Builder |
newBuilderForType()
Constructs a new builder for a message of the same type as this message.
|
static PubsubMessage |
parseDelimitedFrom(java.io.InputStream input) |
static PubsubMessage |
parseDelimitedFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(byte[] data) |
static PubsubMessage |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(ByteString data) |
static PubsubMessage |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(CodedInputStream input) |
static PubsubMessage |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(java.io.InputStream input) |
static PubsubMessage |
parseFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<PubsubMessage> |
parser() |
PubsubMessage.Builder |
toBuilder()
Constructs a builder initialized with the current message.
|
void |
writeTo(CodedOutputStream output)
Serializes the message and writes it to
output. |
getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, newFileScopedGeneratedExtension, newFileScopedGeneratedExtension, newMessageScopedGeneratedExtension, newMessageScopedGeneratedExtensionequals, findInitializationErrors, getInitializationErrorString, hashCode, toStringtoByteArray, toByteString, writeDelimitedTo, writeTofindInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneoftoByteArray, toByteString, writeDelimitedTo, writeTopublic static final int DATA_FIELD_NUMBER
public static final int ATTRIBUTES_FIELD_NUMBER
public static final int MESSAGE_ID_FIELD_NUMBER
public static final int PUBLISH_TIME_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
MessageOrBuilderUnknownFieldSet for this message.getUnknownFields in interface MessageOrBuildergetUnknownFields in class GeneratedMessagepublic static final Descriptors.Descriptor getDescriptor()
public ByteString getData()
The message payload. For JSON requests, the value of this field must be base64-encoded.
getData in interface PubsubMessageOrBuilderpublic java.util.Map<java.lang.String,java.lang.String> getAttributes()
Optional attributes for this message.
getAttributes in interface PubsubMessageOrBuilderpublic java.lang.String getMessageId()
ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a `PubsubMessage` via a `Pull` call or a push delivery. It must not be populated by the publisher in a `Publish` call.
getMessageId in interface PubsubMessageOrBuilderpublic ByteString getMessageIdBytes()
ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a `PubsubMessage` via a `Pull` call or a push delivery. It must not be populated by the publisher in a `Publish` call.
getMessageIdBytes in interface PubsubMessageOrBuilderpublic boolean hasPublishTime()
The time at which the message was published, populated by the server when it receives the `Publish` call. It must not be populated by the publisher in a `Publish` call.
hasPublishTime in interface PubsubMessageOrBuilderpublic Timestamp getPublishTime()
The time at which the message was published, populated by the server when it receives the `Publish` call. It must not be populated by the publisher in a `Publish` call.
getPublishTime in interface PubsubMessageOrBuilderpublic TimestampOrBuilder getPublishTimeOrBuilder()
The time at which the message was published, populated by the server when it receives the `Publish` call. It must not be populated by the publisher in a `Publish` call.
getPublishTimeOrBuilder in interface PubsubMessageOrBuilderpublic final boolean isInitialized()
MessageLiteOrBuilderisInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessagepublic void writeTo(CodedOutputStream output) throws java.io.IOException
MessageLiteoutput. This does not
flush or close the stream.writeTo in interface MessageLitewriteTo in class GeneratedMessagejava.io.IOExceptionpublic int getSerializedSize()
MessageLitegetSerializedSize in interface MessageLitegetSerializedSize in class GeneratedMessagepublic static PubsubMessage parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static PubsubMessage parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static PubsubMessage parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static PubsubMessage parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static PubsubMessage parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static PubsubMessage parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic PubsubMessage.Builder newBuilderForType()
MessageLitenewBuilderForType in interface MessagenewBuilderForType in interface MessageLitepublic static PubsubMessage.Builder newBuilder()
public static PubsubMessage.Builder newBuilder(PubsubMessage prototype)
public PubsubMessage.Builder toBuilder()
MessageLitetoBuilder in interface MessagetoBuilder in interface MessageLitepublic static PubsubMessage getDefaultInstance()
public static Parser<PubsubMessage> parser()
public Parser<PubsubMessage> getParserForType()
MessageLitegetParserForType in interface MessagegetParserForType in interface MessageLitegetParserForType in class GeneratedMessagepublic PubsubMessage getDefaultInstanceForType()
MessageLiteOrBuildergetDefaultInstance() method of generated message classes in that
this method is an abstract method of the MessageLite interface
whereas getDefaultInstance() is a static method of a specific
class. They return the same thing.getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilder