public static final class PubSubMessage.Builder extends GeneratedMessageV3.Builder<PubSubMessage.Builder> implements PubSubMessageOrBuilder
A message that is published by publishers and delivered to subscribers.
Protobuf type google.cloud.pubsublite.v1.PubSubMessage
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public PubSubMessage.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
public PubSubMessage build()
Returns
buildPartial()
public PubSubMessage buildPartial()
Returns
clear()
public PubSubMessage.Builder clear()
Returns
Overrides
clearAttributes()
public PubSubMessage.Builder clearAttributes()
Returns
clearData()
public PubSubMessage.Builder clearData()
The payload of the message.
bytes data = 2;
Returns
clearEventTime()
public PubSubMessage.Builder clearEventTime()
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
Returns
clearField(Descriptors.FieldDescriptor field)
public PubSubMessage.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearKey()
public PubSubMessage.Builder clearKey()
The key used for routing messages to partitions or for compaction (e.g.,
keep the last N messages per key). If the key is empty, the message is
routed to an arbitrary partition.
bytes key = 1;
Returns
clearOneof(Descriptors.OneofDescriptor oneof)
public PubSubMessage.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
clone()
public PubSubMessage.Builder clone()
Returns
Overrides
containsAttributes(String key)
public boolean containsAttributes(String key)
Optional attributes that can be used for message metadata/headers.
map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
Parameter
Returns
getAttributes()
public Map<String,AttributeValues> getAttributes()
Returns
getAttributesCount()
public int getAttributesCount()
Optional attributes that can be used for message metadata/headers.
map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
Returns
getAttributesMap()
public Map<String,AttributeValues> getAttributesMap()
Optional attributes that can be used for message metadata/headers.
map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
Returns
getAttributesOrDefault(String key, AttributeValues defaultValue)
public AttributeValues getAttributesOrDefault(String key, AttributeValues defaultValue)
Optional attributes that can be used for message metadata/headers.
map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
Parameters
Returns
getAttributesOrThrow(String key)
public AttributeValues getAttributesOrThrow(String key)
Optional attributes that can be used for message metadata/headers.
map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
Parameter
Returns
getData()
public ByteString getData()
The payload of the message.
bytes data = 2;
Returns
getDefaultInstanceForType()
public PubSubMessage getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
getEventTime()
public Timestamp getEventTime()
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
Returns
getEventTimeBuilder()
public Timestamp.Builder getEventTimeBuilder()
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
Returns
getEventTimeOrBuilder()
public TimestampOrBuilder getEventTimeOrBuilder()
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
Returns
getKey()
public ByteString getKey()
The key used for routing messages to partitions or for compaction (e.g.,
keep the last N messages per key). If the key is empty, the message is
routed to an arbitrary partition.
bytes key = 1;
Returns
getMutableAttributes()
public Map<String,AttributeValues> getMutableAttributes()
Use alternate mutation accessors instead.
Returns
hasEventTime()
public boolean hasEventTime()
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
Returns
Type | Description |
boolean | Whether the eventTime field is set.
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Parameter
Returns
Overrides
internalGetMutableMapField(int number)
protected MapField internalGetMutableMapField(int number)
Parameter
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeEventTime(Timestamp value)
public PubSubMessage.Builder mergeEventTime(Timestamp value)
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
Parameter
Returns
mergeFrom(PubSubMessage other)
public PubSubMessage.Builder mergeFrom(PubSubMessage other)
Parameter
Returns
public PubSubMessage.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public PubSubMessage.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final PubSubMessage.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
putAllAttributes(Map<String,AttributeValues> values)
public PubSubMessage.Builder putAllAttributes(Map<String,AttributeValues> values)
Optional attributes that can be used for message metadata/headers.
map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
Parameter
Returns
putAttributes(String key, AttributeValues value)
public PubSubMessage.Builder putAttributes(String key, AttributeValues value)
Optional attributes that can be used for message metadata/headers.
map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
Parameters
Returns
removeAttributes(String key)
public PubSubMessage.Builder removeAttributes(String key)
Optional attributes that can be used for message metadata/headers.
map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
Parameter
Returns
setData(ByteString value)
public PubSubMessage.Builder setData(ByteString value)
The payload of the message.
bytes data = 2;
Parameter
Returns
setEventTime(Timestamp value)
public PubSubMessage.Builder setEventTime(Timestamp value)
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
Parameter
Returns
setEventTime(Timestamp.Builder builderForValue)
public PubSubMessage.Builder setEventTime(Timestamp.Builder builderForValue)
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
Parameter
Name | Description |
builderForValue | Builder
|
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public PubSubMessage.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setKey(ByteString value)
public PubSubMessage.Builder setKey(ByteString value)
The key used for routing messages to partitions or for compaction (e.g.,
keep the last N messages per key). If the key is empty, the message is
routed to an arbitrary partition.
bytes key = 1;
Parameter
Returns
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public PubSubMessage.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final PubSubMessage.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides