Class PubSubMessage (1.15.0)

public final class PubSubMessage extends GeneratedMessageV3 implements PubSubMessageOrBuilder

A message that is published by publishers and delivered to subscribers.

Protobuf type google.cloud.pubsublite.v1.PubSubMessage

Static Fields

ATTRIBUTES_FIELD_NUMBER

public static final int ATTRIBUTES_FIELD_NUMBER
Field Value
Type Description
int

DATA_FIELD_NUMBER

public static final int DATA_FIELD_NUMBER
Field Value
Type Description
int

EVENT_TIME_FIELD_NUMBER

public static final int EVENT_TIME_FIELD_NUMBER
Field Value
Type Description
int

KEY_FIELD_NUMBER

public static final int KEY_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static PubSubMessage getDefaultInstance()
Returns
Type Description
PubSubMessage

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static PubSubMessage.Builder newBuilder()
Returns
Type Description
PubSubMessage.Builder

newBuilder(PubSubMessage prototype)

public static PubSubMessage.Builder newBuilder(PubSubMessage prototype)
Parameter
Name Description
prototype PubSubMessage
Returns
Type Description
PubSubMessage.Builder

parseDelimitedFrom(InputStream input)

public static PubSubMessage parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
PubSubMessage
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PubSubMessage
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static PubSubMessage parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
PubSubMessage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PubSubMessage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static PubSubMessage parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
PubSubMessage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PubSubMessage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static PubSubMessage parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
PubSubMessage
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PubSubMessage
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static PubSubMessage parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
PubSubMessage
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PubSubMessage
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static PubSubMessage parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
PubSubMessage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PubSubMessage
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<PubSubMessage> parser()
Returns
Type Description
Parser<PubSubMessage>

Methods

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
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAttributes() (deprecated)

public Map<String,AttributeValues> getAttributes()

Use #getAttributesMap() instead.

Returns
Type Description
Map<String,AttributeValues>

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;

Returns
Type Description
Map<String,AttributeValues>

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
Name Description
key String
defaultValue AttributeValues
Returns
Type Description
AttributeValues

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
Returns
Type Description
AttributeValues

getData()

public ByteString getData()

The payload of the message.

bytes data = 2;

Returns
Type Description
ByteString

The data.

getDefaultInstanceForType()

public PubSubMessage getDefaultInstanceForType()
Returns
Type Description
PubSubMessage

getEventTime()

public Timestamp getEventTime()

An optional, user-specified event time.

.google.protobuf.Timestamp event_time = 4;

Returns
Type Description
Timestamp

The eventTime.

getEventTimeOrBuilder()

public TimestampOrBuilder getEventTimeOrBuilder()

An optional, user-specified event time.

.google.protobuf.Timestamp event_time = 4;

Returns
Type Description
TimestampOrBuilder

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
Type Description
ByteString

The key.

getParserForType()

public Parser<PubSubMessage> getParserForType()
Returns
Type Description
Parser<PubSubMessage>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public PubSubMessage.Builder newBuilderForType()
Returns
Type Description
PubSubMessage.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected PubSubMessage.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
PubSubMessage.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public PubSubMessage.Builder toBuilder()
Returns
Type Description
PubSubMessage.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException