Class PubsubMessage.Builder (0.14.1)

public static final class PubsubMessage.Builder extends GeneratedMessageV3.Builder<PubsubMessage.Builder> implements PubsubMessageOrBuilder

A message published to a topic.

Protobuf type google.events.cloud.pubsub.v1.PubsubMessage

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PubsubMessage.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PubsubMessage.Builder
Overrides

build()

public PubsubMessage build()
Returns
TypeDescription
PubsubMessage

buildPartial()

public PubsubMessage buildPartial()
Returns
TypeDescription
PubsubMessage

clear()

public PubsubMessage.Builder clear()
Returns
TypeDescription
PubsubMessage.Builder
Overrides

clearAttributes()

public PubsubMessage.Builder clearAttributes()
Returns
TypeDescription
PubsubMessage.Builder

clearData()

public PubsubMessage.Builder clearData()

The binary data in the message.

bytes data = 1;

Returns
TypeDescription
PubsubMessage.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public PubsubMessage.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
PubsubMessage.Builder
Overrides

clearMessageId()

public PubsubMessage.Builder clearMessageId()

ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic.

string message_id = 3;

Returns
TypeDescription
PubsubMessage.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public PubsubMessage.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
PubsubMessage.Builder
Overrides

clearOrderingKey()

public PubsubMessage.Builder clearOrderingKey()

If non-empty, identifies related messages for which publish order should be respected.

string ordering_key = 5;

Returns
TypeDescription
PubsubMessage.Builder

This builder for chaining.

clearPublishTime()

public PubsubMessage.Builder clearPublishTime()

The time at which the message was published, populated by the server when it receives the Publish call.

.google.protobuf.Timestamp publish_time = 4;

Returns
TypeDescription
PubsubMessage.Builder

clone()

public PubsubMessage.Builder clone()
Returns
TypeDescription
PubsubMessage.Builder
Overrides

containsAttributes(String key)

public boolean containsAttributes(String key)

Attributes for this message.

map<string, string> attributes = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getAttributes()

public Map<String,String> getAttributes()

Use #getAttributesMap() instead.

Returns
TypeDescription
Map<String,String>

getAttributesCount()

public int getAttributesCount()

Attributes for this message.

map<string, string> attributes = 2;

Returns
TypeDescription
int

getAttributesMap()

public Map<String,String> getAttributesMap()

Attributes for this message.

map<string, string> attributes = 2;

Returns
TypeDescription
Map<String,String>

getAttributesOrDefault(String key, String defaultValue)

public String getAttributesOrDefault(String key, String defaultValue)

Attributes for this message.

map<string, string> attributes = 2;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getAttributesOrThrow(String key)

public String getAttributesOrThrow(String key)

Attributes for this message.

map<string, string> attributes = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getData()

public ByteString getData()

The binary data in the message.

bytes data = 1;

Returns
TypeDescription
ByteString

The data.

getDefaultInstanceForType()

public PubsubMessage getDefaultInstanceForType()
Returns
TypeDescription
PubsubMessage

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMessageId()

public String getMessageId()

ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic.

string message_id = 3;

Returns
TypeDescription
String

The messageId.

getMessageIdBytes()

public ByteString getMessageIdBytes()

ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic.

string message_id = 3;

Returns
TypeDescription
ByteString

The bytes for messageId.

getMutableAttributes()

public Map<String,String> getMutableAttributes()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getOrderingKey()

public String getOrderingKey()

If non-empty, identifies related messages for which publish order should be respected.

string ordering_key = 5;

Returns
TypeDescription
String

The orderingKey.

getOrderingKeyBytes()

public ByteString getOrderingKeyBytes()

If non-empty, identifies related messages for which publish order should be respected.

string ordering_key = 5;

Returns
TypeDescription
ByteString

The bytes for orderingKey.

getPublishTime()

public Timestamp getPublishTime()

The time at which the message was published, populated by the server when it receives the Publish call.

.google.protobuf.Timestamp publish_time = 4;

Returns
TypeDescription
Timestamp

The publishTime.

getPublishTimeBuilder()

public Timestamp.Builder getPublishTimeBuilder()

The time at which the message was published, populated by the server when it receives the Publish call.

.google.protobuf.Timestamp publish_time = 4;

Returns
TypeDescription
Builder

getPublishTimeOrBuilder()

public TimestampOrBuilder getPublishTimeOrBuilder()

The time at which the message was published, populated by the server when it receives the Publish call.

.google.protobuf.Timestamp publish_time = 4;

Returns
TypeDescription
TimestampOrBuilder

hasPublishTime()

public boolean hasPublishTime()

The time at which the message was published, populated by the server when it receives the Publish call.

.google.protobuf.Timestamp publish_time = 4;

Returns
TypeDescription
boolean

Whether the publishTime field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(PubsubMessage other)

public PubsubMessage.Builder mergeFrom(PubsubMessage other)
Parameter
NameDescription
otherPubsubMessage
Returns
TypeDescription
PubsubMessage.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public PubsubMessage.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PubsubMessage.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public PubsubMessage.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
PubsubMessage.Builder
Overrides

mergePublishTime(Timestamp value)

public PubsubMessage.Builder mergePublishTime(Timestamp value)

The time at which the message was published, populated by the server when it receives the Publish call.

.google.protobuf.Timestamp publish_time = 4;

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
PubsubMessage.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PubsubMessage.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PubsubMessage.Builder
Overrides

putAllAttributes(Map<String,String> values)

public PubsubMessage.Builder putAllAttributes(Map<String,String> values)

Attributes for this message.

map<string, string> attributes = 2;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
PubsubMessage.Builder

putAttributes(String key, String value)

public PubsubMessage.Builder putAttributes(String key, String value)

Attributes for this message.

map<string, string> attributes = 2;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
PubsubMessage.Builder

removeAttributes(String key)

public PubsubMessage.Builder removeAttributes(String key)

Attributes for this message.

map<string, string> attributes = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
PubsubMessage.Builder

setData(ByteString value)

public PubsubMessage.Builder setData(ByteString value)

The binary data in the message.

bytes data = 1;

Parameter
NameDescription
valueByteString

The data to set.

Returns
TypeDescription
PubsubMessage.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public PubsubMessage.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PubsubMessage.Builder
Overrides

setMessageId(String value)

public PubsubMessage.Builder setMessageId(String value)

ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic.

string message_id = 3;

Parameter
NameDescription
valueString

The messageId to set.

Returns
TypeDescription
PubsubMessage.Builder

This builder for chaining.

setMessageIdBytes(ByteString value)

public PubsubMessage.Builder setMessageIdBytes(ByteString value)

ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic.

string message_id = 3;

Parameter
NameDescription
valueByteString

The bytes for messageId to set.

Returns
TypeDescription
PubsubMessage.Builder

This builder for chaining.

setOrderingKey(String value)

public PubsubMessage.Builder setOrderingKey(String value)

If non-empty, identifies related messages for which publish order should be respected.

string ordering_key = 5;

Parameter
NameDescription
valueString

The orderingKey to set.

Returns
TypeDescription
PubsubMessage.Builder

This builder for chaining.

setOrderingKeyBytes(ByteString value)

public PubsubMessage.Builder setOrderingKeyBytes(ByteString value)

If non-empty, identifies related messages for which publish order should be respected.

string ordering_key = 5;

Parameter
NameDescription
valueByteString

The bytes for orderingKey to set.

Returns
TypeDescription
PubsubMessage.Builder

This builder for chaining.

setPublishTime(Timestamp value)

public PubsubMessage.Builder setPublishTime(Timestamp value)

The time at which the message was published, populated by the server when it receives the Publish call.

.google.protobuf.Timestamp publish_time = 4;

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
PubsubMessage.Builder

setPublishTime(Timestamp.Builder builderForValue)

public PubsubMessage.Builder setPublishTime(Timestamp.Builder builderForValue)

The time at which the message was published, populated by the server when it receives the Publish call.

.google.protobuf.Timestamp publish_time = 4;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
PubsubMessage.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public PubsubMessage.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
PubsubMessage.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final PubsubMessage.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PubsubMessage.Builder
Overrides