public final class PubsubMessage extends com.google.protobuf.GeneratedMessageV3 implements PubsubMessageOrBuilder
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.Protobuf type
google.pubsub.v1.PubsubMessage
Modifier and Type | Class and Description |
---|---|
static class |
PubsubMessage.Builder
A message data and its attributes.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
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 |
---|---|
boolean |
containsAttributes(java.lang.String key)
Optional attributes for this message.
|
boolean |
equals(java.lang.Object obj) |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Deprecated.
|
int |
getAttributesCount()
Optional attributes for this message.
|
java.util.Map<java.lang.String,java.lang.String> |
getAttributesMap()
Optional attributes for this message.
|
java.lang.String |
getAttributesOrDefault(java.lang.String key,
java.lang.String defaultValue)
Optional attributes for this message.
|
java.lang.String |
getAttributesOrThrow(java.lang.String key)
Optional attributes for this message.
|
com.google.protobuf.ByteString |
getData()
The message payload.
|
static PubsubMessage |
getDefaultInstance() |
PubsubMessage |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
java.lang.String |
getMessageId()
ID of this message, assigned by the server when the message is published.
|
com.google.protobuf.ByteString |
getMessageIdBytes()
ID of this message, assigned by the server when the message is published.
|
com.google.protobuf.Parser<PubsubMessage> |
getParserForType() |
com.google.protobuf.Timestamp |
getPublishTime()
The time at which the message was published, populated by the server when
it receives the `Publish` call.
|
com.google.protobuf.TimestampOrBuilder |
getPublishTimeOrBuilder()
The time at which the message was published, populated by the server when
it receives the `Publish` call.
|
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
boolean |
hasPublishTime()
The time at which the message was published, populated by the server when
it receives the `Publish` call.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected com.google.protobuf.MapField |
internalGetMapField(int number) |
boolean |
isInitialized() |
static PubsubMessage.Builder |
newBuilder() |
static PubsubMessage.Builder |
newBuilder(PubsubMessage prototype) |
PubsubMessage.Builder |
newBuilderForType() |
protected PubsubMessage.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static PubsubMessage |
parseDelimitedFrom(java.io.InputStream input) |
static PubsubMessage |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(byte[] data) |
static PubsubMessage |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(java.nio.ByteBuffer data) |
static PubsubMessage |
parseFrom(java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(com.google.protobuf.ByteString data) |
static PubsubMessage |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(com.google.protobuf.CodedInputStream input) |
static PubsubMessage |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(java.io.InputStream input) |
static PubsubMessage |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<PubsubMessage> |
parser() |
PubsubMessage.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public 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 com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields
in interface com.google.protobuf.MessageOrBuilder
getUnknownFields
in class com.google.protobuf.GeneratedMessageV3
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.MapField internalGetMapField(int number)
internalGetMapField
in class com.google.protobuf.GeneratedMessageV3
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.GeneratedMessageV3
public com.google.protobuf.ByteString getData()
The message payload.
bytes data = 1;
getData
in interface PubsubMessageOrBuilder
public int getAttributesCount()
PubsubMessageOrBuilder
Optional attributes for this message.
map<string, string> attributes = 2;
getAttributesCount
in interface PubsubMessageOrBuilder
public boolean containsAttributes(java.lang.String key)
Optional attributes for this message.
map<string, string> attributes = 2;
containsAttributes
in interface PubsubMessageOrBuilder
@Deprecated public java.util.Map<java.lang.String,java.lang.String> getAttributes()
getAttributesMap()
instead.getAttributes
in interface PubsubMessageOrBuilder
public java.util.Map<java.lang.String,java.lang.String> getAttributesMap()
Optional attributes for this message.
map<string, string> attributes = 2;
getAttributesMap
in interface PubsubMessageOrBuilder
public java.lang.String getAttributesOrDefault(java.lang.String key, java.lang.String defaultValue)
Optional attributes for this message.
map<string, string> attributes = 2;
getAttributesOrDefault
in interface PubsubMessageOrBuilder
public java.lang.String getAttributesOrThrow(java.lang.String key)
Optional attributes for this message.
map<string, string> attributes = 2;
getAttributesOrThrow
in interface PubsubMessageOrBuilder
public 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.
string message_id = 3;
getMessageId
in interface PubsubMessageOrBuilder
public com.google.protobuf.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.
string message_id = 3;
getMessageIdBytes
in interface PubsubMessageOrBuilder
public 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.
.google.protobuf.Timestamp publish_time = 4;
hasPublishTime
in interface PubsubMessageOrBuilder
public com.google.protobuf.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.
.google.protobuf.Timestamp publish_time = 4;
getPublishTime
in interface PubsubMessageOrBuilder
public com.google.protobuf.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.
.google.protobuf.Timestamp publish_time = 4;
getPublishTimeOrBuilder
in interface PubsubMessageOrBuilder
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessageV3
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException
writeTo
in interface com.google.protobuf.MessageLite
writeTo
in class com.google.protobuf.GeneratedMessageV3
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface com.google.protobuf.MessageLite
getSerializedSize
in class com.google.protobuf.GeneratedMessageV3
public boolean equals(java.lang.Object obj)
equals
in interface com.google.protobuf.Message
equals
in class com.google.protobuf.AbstractMessage
public int hashCode()
hashCode
in interface com.google.protobuf.Message
hashCode
in class com.google.protobuf.AbstractMessage
public static PubsubMessage parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static PubsubMessage parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static PubsubMessage parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static PubsubMessage parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static PubsubMessage parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static PubsubMessage parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static PubsubMessage parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static PubsubMessage parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static PubsubMessage parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static PubsubMessage parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static PubsubMessage parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOException
public static PubsubMessage parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public PubsubMessage.Builder newBuilderForType()
newBuilderForType
in interface com.google.protobuf.Message
newBuilderForType
in interface com.google.protobuf.MessageLite
public static PubsubMessage.Builder newBuilder()
public static PubsubMessage.Builder newBuilder(PubsubMessage prototype)
public PubsubMessage.Builder toBuilder()
toBuilder
in interface com.google.protobuf.Message
toBuilder
in interface com.google.protobuf.MessageLite
protected PubsubMessage.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class com.google.protobuf.GeneratedMessageV3
public static PubsubMessage getDefaultInstance()
public static com.google.protobuf.Parser<PubsubMessage> parser()
public com.google.protobuf.Parser<PubsubMessage> getParserForType()
getParserForType
in interface com.google.protobuf.Message
getParserForType
in interface com.google.protobuf.MessageLite
getParserForType
in class com.google.protobuf.GeneratedMessageV3
public PubsubMessage getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder