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
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public PubSubMessage.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
public PubSubMessage build()
buildPartial()
public PubSubMessage buildPartial()
clear()
public PubSubMessage.Builder clear()
Overrides
clearAttributes()
public PubSubMessage.Builder clearAttributes()
clearData()
public PubSubMessage.Builder clearData()
The payload of the message.
bytes data = 2;
clearEventTime()
public PubSubMessage.Builder clearEventTime()
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
clearField(Descriptors.FieldDescriptor field)
public PubSubMessage.Builder clearField(Descriptors.FieldDescriptor field)
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;
clearOneof(Descriptors.OneofDescriptor oneof)
public PubSubMessage.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clone()
public PubSubMessage.Builder clone()
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 |
---|
Name | Description |
key | String
|
getAttributes()
public Map<String,AttributeValues> getAttributes()
getAttributesCount()
public int getAttributesCount()
Optional attributes that can be used for message metadata/headers.
map<string, .google.cloud.pubsublite.v1.AttributeValues> attributes = 3;
Returns |
---|
Type | Description |
int | |
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;
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;
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 |
---|
Name | Description |
key | String
|
getData()
public ByteString getData()
The payload of the message.
bytes data = 2;
getDefaultInstanceForType()
public PubSubMessage getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Overrides
getEventTime()
public Timestamp getEventTime()
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
Returns |
---|
Type | Description |
Timestamp | The eventTime.
|
getEventTimeBuilder()
public Timestamp.Builder getEventTimeBuilder()
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
getEventTimeOrBuilder()
public TimestampOrBuilder getEventTimeOrBuilder()
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
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;
getMutableAttributes()
public Map<String,AttributeValues> getMutableAttributes()
Use alternate mutation accessors instead.
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()
Overrides
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Parameter |
---|
Name | Description |
number | int
|
Overrides
internalGetMutableMapField(int number)
protected MapField internalGetMutableMapField(int number)
Parameter |
---|
Name | Description |
number | int
|
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
mergeEventTime(Timestamp value)
public PubSubMessage.Builder mergeEventTime(Timestamp value)
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
mergeFrom(PubSubMessage other)
public PubSubMessage.Builder mergeFrom(PubSubMessage other)
public PubSubMessage.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public PubSubMessage.Builder mergeFrom(Message other)
Parameter |
---|
Name | Description |
other | Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final PubSubMessage.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
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;
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;
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 |
---|
Name | Description |
key | String
|
setData(ByteString value)
public PubSubMessage.Builder setData(ByteString value)
The payload of the message.
bytes data = 2;
Parameter |
---|
Name | Description |
value | ByteString
The data to set.
|
setEventTime(Timestamp value)
public PubSubMessage.Builder setEventTime(Timestamp value)
An optional, user-specified event time.
.google.protobuf.Timestamp event_time = 4;
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
|
setField(Descriptors.FieldDescriptor field, Object value)
public PubSubMessage.Builder setField(Descriptors.FieldDescriptor field, Object value)
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 |
---|
Name | Description |
value | ByteString
The key to set.
|
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public PubSubMessage.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final PubSubMessage.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides