Class PubSubMessage (1.4.12)

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
TypeDescription
int

DATA_FIELD_NUMBER

public static final int DATA_FIELD_NUMBER
Field Value
TypeDescription
int

EVENT_TIME_FIELD_NUMBER

public static final int EVENT_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

KEY_FIELD_NUMBER

public static final int KEY_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static PubSubMessage getDefaultInstance()
Returns
TypeDescription
PubSubMessage

getDescriptor()

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

newBuilder()

public static PubSubMessage.Builder newBuilder()
Returns
TypeDescription
PubSubMessage.Builder

newBuilder(PubSubMessage prototype)

public static PubSubMessage.Builder newBuilder(PubSubMessage prototype)
Parameter
NameDescription
prototypePubSubMessage
Returns
TypeDescription
PubSubMessage.Builder

parseDelimitedFrom(InputStream input)

public static PubSubMessage parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static PubSubMessage parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static PubSubMessage parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static PubSubMessage parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static PubSubMessage parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static PubSubMessage parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static PubSubMessage parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PubSubMessage
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<PubSubMessage> parser()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getAttributes()

public Map<String,AttributeValues> getAttributes()

Use #getAttributesMap() instead.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
keyString
defaultValueAttributeValues
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
AttributeValues

getData()

public ByteString getData()

The payload of the message.

bytes data = 2;

Returns
TypeDescription
ByteString

The data.

getDefaultInstanceForType()

public PubSubMessage getDefaultInstanceForType()
Returns
TypeDescription
PubSubMessage

getEventTime()

public Timestamp getEventTime()

An optional, user-specified event time.

.google.protobuf.Timestamp event_time = 4;

Returns
TypeDescription
Timestamp

The eventTime.

getEventTimeOrBuilder()

public TimestampOrBuilder getEventTimeOrBuilder()

An optional, user-specified event time.

.google.protobuf.Timestamp event_time = 4;

Returns
TypeDescription
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
TypeDescription
ByteString

The key.

getParserForType()

public Parser<PubSubMessage> getParserForType()
Returns
TypeDescription
Parser<PubSubMessage>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hasEventTime()

public boolean hasEventTime()

An optional, user-specified event time.

.google.protobuf.Timestamp event_time = 4;

Returns
TypeDescription
boolean

Whether the eventTime field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public PubSubMessage.Builder newBuilderForType()
Returns
TypeDescription
PubSubMessage.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected PubSubMessage.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
PubSubMessage.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public PubSubMessage.Builder toBuilder()
Returns
TypeDescription
PubSubMessage.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException