public class PubsubMessage
extends java.lang.Object
Constructor and Description |
---|
PubsubMessage(byte[] payload,
@Nullable java.util.Map<java.lang.String,java.lang.String> attributes) |
PubsubMessage(byte[] payload,
@Nullable java.util.Map<java.lang.String,java.lang.String> attributes,
@Nullable java.lang.String messageId) |
PubsubMessage(byte[] payload,
@Nullable java.util.Map<java.lang.String,java.lang.String> attributes,
@Nullable java.lang.String messageId,
@Nullable java.lang.String orderingKey) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
@Nullable java.lang.String |
getAttribute(java.lang.String attribute)
Returns the given attribute value.
|
@Nullable java.util.Map<java.lang.String,java.lang.String> |
getAttributeMap()
Returns the full map of attributes.
|
@Nullable java.lang.String |
getMessageId()
Returns the messageId of the message populated by Cloud Pub/Sub.
|
@Nullable java.lang.String |
getOrderingKey()
Returns the ordering key of the message.
|
byte[] |
getPayload()
Returns the main PubSub message.
|
@Nullable java.lang.String |
getTopic() |
int |
hashCode() |
java.lang.String |
toString() |
PubsubMessage |
withTopic(java.lang.String topic) |
public PubsubMessage(byte[] payload, @Nullable java.util.Map<java.lang.String,java.lang.String> attributes)
public PubsubMessage(byte[] payload, @Nullable java.util.Map<java.lang.String,java.lang.String> attributes, @Nullable java.lang.String messageId)
public PubsubMessage(byte[] payload, @Nullable java.util.Map<java.lang.String,java.lang.String> attributes, @Nullable java.lang.String messageId, @Nullable java.lang.String orderingKey)
public PubsubMessage withTopic(java.lang.String topic)
public @Nullable java.lang.String getTopic()
public byte[] getPayload()
public @Nullable java.lang.String getAttribute(java.lang.String attribute)
public @Nullable java.util.Map<java.lang.String,java.lang.String> getAttributeMap()
public @Nullable java.lang.String getMessageId()
public @Nullable java.lang.String getOrderingKey()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object