Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/pubsub/v1/pubsub.proto
// Protobuf Java Version: 3.25.5
package com.google.pubsub.v1;
/**
*
*
*
* A message that is published by publishers and consumed by subscribers. The
* message must contain either a non-empty data field or at least one attribute.
* Note that client libraries represent this object differently
* depending on the language. See the corresponding [client library
* documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for
* more information. See [quotas and limits]
* (https://cloud.google.com/pubsub/quotas) for more information about message
* limits.
*
*
* Protobuf type {@code google.pubsub.v1.PubsubMessage}
*/
public final class PubsubMessage extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.pubsub.v1.PubsubMessage)
PubsubMessageOrBuilder {
private static final long serialVersionUID = 0L;
// Use PubsubMessage.newBuilder() to construct.
private PubsubMessage(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private PubsubMessage() {
data_ = com.google.protobuf.ByteString.EMPTY;
messageId_ = "";
orderingKey_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new PubsubMessage();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_PubsubMessage_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 2:
return internalGetAttributes();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.pubsub.v1.PubsubMessage.class,
com.google.pubsub.v1.PubsubMessage.Builder.class);
}
private int bitField0_;
public static final int DATA_FIELD_NUMBER = 1;
private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
/**
*
*
*
* Optional. The message data field. If this field is empty, the message must
* contain at least one attribute.
*
*
* bytes data = 1 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The data.
*/
@java.lang.Override
public com.google.protobuf.ByteString getData() {
return data_;
}
public static final int ATTRIBUTES_FIELD_NUMBER = 2;
private static final class AttributesDefaultEntryHolder {
static final com.google.protobuf.MapEntry defaultEntry =
com.google.protobuf.MapEntry.newDefaultInstance(
com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField attributes_;
private com.google.protobuf.MapField internalGetAttributes() {
if (attributes_ == null) {
return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry);
}
return attributes_;
}
public int getAttributesCount() {
return internalGetAttributes().getMap().size();
}
/**
*
*
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
*
* map<string, string> attributes = 2 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public boolean containsAttributes(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetAttributes().getMap().containsKey(key);
}
/** Use {@link #getAttributesMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getAttributes() {
return getAttributesMap();
}
/**
*
*
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
*
* map<string, string> attributes = 2 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.lang.String getAttributesOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetAttributes().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int MESSAGE_ID_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile java.lang.Object messageId_ = "";
/**
*
*
*
* ID of this message, assigned by the server when the message is published.
* Guaranteed to be unique within the topic. This value may be read by a
* subscriber that receives a `PubsubMessage` via a `Pull` call or a push
* delivery. It must not be populated by the publisher in a `Publish` call.
*
* ID of this message, assigned by the server when the message is published.
* Guaranteed to be unique within the topic. This value may be read by a
* subscriber that receives a `PubsubMessage` via a `Pull` call or a push
* delivery. It must not be populated by the publisher in a `Publish` call.
*
*
* string message_id = 3;
*
* @return The bytes for messageId.
*/
@java.lang.Override
public com.google.protobuf.ByteString getMessageIdBytes() {
java.lang.Object ref = messageId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
messageId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PUBLISH_TIME_FIELD_NUMBER = 4;
private com.google.protobuf.Timestamp publishTime_;
/**
*
*
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
*
* .google.protobuf.Timestamp publish_time = 4;
*
* @return Whether the publishTime field is set.
*/
@java.lang.Override
public boolean hasPublishTime() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
*
* .google.protobuf.Timestamp publish_time = 4;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder() {
return publishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : publishTime_;
}
public static final int ORDERING_KEY_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private volatile java.lang.Object orderingKey_ = "";
/**
*
*
*
* Optional. If non-empty, identifies related messages for which publish order
* should be respected. If a `Subscription` has `enable_message_ordering` set
* to `true`, messages published with the same non-empty `ordering_key` value
* will be delivered to subscribers in the order in which they are received by
* the Pub/Sub system. All `PubsubMessage`s published in a given
* `PublishRequest` must specify the same `ordering_key` value. For more
* information, see [ordering
* messages](https://cloud.google.com/pubsub/docs/ordering).
*
* Optional. If non-empty, identifies related messages for which publish order
* should be respected. If a `Subscription` has `enable_message_ordering` set
* to `true`, messages published with the same non-empty `ordering_key` value
* will be delivered to subscribers in the order in which they are received by
* the Pub/Sub system. All `PubsubMessage`s published in a given
* `PublishRequest` must specify the same `ordering_key` value. For more
* information, see [ordering
* messages](https://cloud.google.com/pubsub/docs/ordering).
*
* A message that is published by publishers and consumed by subscribers. The
* message must contain either a non-empty data field or at least one attribute.
* Note that client libraries represent this object differently
* depending on the language. See the corresponding [client library
* documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for
* more information. See [quotas and limits]
* (https://cloud.google.com/pubsub/quotas) for more information about message
* limits.
*
*
* Protobuf type {@code google.pubsub.v1.PubsubMessage}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.pubsub.v1.PubsubMessage)
com.google.pubsub.v1.PubsubMessageOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_PubsubMessage_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 2:
return internalGetAttributes();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 2:
return internalGetMutableAttributes();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.pubsub.v1.PubsubMessage.class,
com.google.pubsub.v1.PubsubMessage.Builder.class);
}
// Construct using com.google.pubsub.v1.PubsubMessage.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getPublishTimeFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
data_ = com.google.protobuf.ByteString.EMPTY;
internalGetMutableAttributes().clear();
messageId_ = "";
publishTime_ = null;
if (publishTimeBuilder_ != null) {
publishTimeBuilder_.dispose();
publishTimeBuilder_ = null;
}
orderingKey_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_PubsubMessage_descriptor;
}
@java.lang.Override
public com.google.pubsub.v1.PubsubMessage getDefaultInstanceForType() {
return com.google.pubsub.v1.PubsubMessage.getDefaultInstance();
}
@java.lang.Override
public com.google.pubsub.v1.PubsubMessage build() {
com.google.pubsub.v1.PubsubMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.pubsub.v1.PubsubMessage buildPartial() {
com.google.pubsub.v1.PubsubMessage result = new com.google.pubsub.v1.PubsubMessage(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(com.google.pubsub.v1.PubsubMessage result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.data_ = data_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.attributes_ = internalGetAttributes();
result.attributes_.makeImmutable();
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.messageId_ = messageId_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000008) != 0)) {
result.publishTime_ =
publishTimeBuilder_ == null ? publishTime_ : publishTimeBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.orderingKey_ = orderingKey_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.pubsub.v1.PubsubMessage) {
return mergeFrom((com.google.pubsub.v1.PubsubMessage) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.pubsub.v1.PubsubMessage other) {
if (other == com.google.pubsub.v1.PubsubMessage.getDefaultInstance()) return this;
if (other.getData() != com.google.protobuf.ByteString.EMPTY) {
setData(other.getData());
}
internalGetMutableAttributes().mergeFrom(other.internalGetAttributes());
bitField0_ |= 0x00000002;
if (!other.getMessageId().isEmpty()) {
messageId_ = other.messageId_;
bitField0_ |= 0x00000004;
onChanged();
}
if (other.hasPublishTime()) {
mergePublishTime(other.getPublishTime());
}
if (!other.getOrderingKey().isEmpty()) {
orderingKey_ = other.orderingKey_;
bitField0_ |= 0x00000010;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
data_ = input.readBytes();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
com.google.protobuf.MapEntry attributes__ =
input.readMessage(
AttributesDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableAttributes()
.getMutableMap()
.put(attributes__.getKey(), attributes__.getValue());
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
messageId_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 26
case 34:
{
input.readMessage(getPublishTimeFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000008;
break;
} // case 34
case 42:
{
orderingKey_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000010;
break;
} // case 42
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
/**
*
*
*
* Optional. The message data field. If this field is empty, the message must
* contain at least one attribute.
*
*
* bytes data = 1 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The data.
*/
@java.lang.Override
public com.google.protobuf.ByteString getData() {
return data_;
}
/**
*
*
*
* Optional. The message data field. If this field is empty, the message must
* contain at least one attribute.
*
*
* bytes data = 1 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The data to set.
* @return This builder for chaining.
*/
public Builder setData(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
data_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Optional. The message data field. If this field is empty, the message must
* contain at least one attribute.
*
*
* bytes data = 1 [(.google.api.field_behavior) = OPTIONAL];
*
* @return This builder for chaining.
*/
public Builder clearData() {
bitField0_ = (bitField0_ & ~0x00000001);
data_ = getDefaultInstance().getData();
onChanged();
return this;
}
private com.google.protobuf.MapField attributes_;
private com.google.protobuf.MapField
internalGetAttributes() {
if (attributes_ == null) {
return com.google.protobuf.MapField.emptyMapField(
AttributesDefaultEntryHolder.defaultEntry);
}
return attributes_;
}
private com.google.protobuf.MapField
internalGetMutableAttributes() {
if (attributes_ == null) {
attributes_ =
com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry);
}
if (!attributes_.isMutable()) {
attributes_ = attributes_.copy();
}
bitField0_ |= 0x00000002;
onChanged();
return attributes_;
}
public int getAttributesCount() {
return internalGetAttributes().getMap().size();
}
/**
*
*
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
*
* map<string, string> attributes = 2 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public boolean containsAttributes(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetAttributes().getMap().containsKey(key);
}
/** Use {@link #getAttributesMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getAttributes() {
return getAttributesMap();
}
/**
*
*
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
*
* map<string, string> attributes = 2 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.lang.String getAttributesOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetAttributes().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearAttributes() {
bitField0_ = (bitField0_ & ~0x00000002);
internalGetMutableAttributes().getMutableMap().clear();
return this;
}
/**
*
*
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
* Optional. Attributes for this message. If this field is empty, the message
* must contain non-empty data. This can be used to filter messages on the
* subscription.
*
* ID of this message, assigned by the server when the message is published.
* Guaranteed to be unique within the topic. This value may be read by a
* subscriber that receives a `PubsubMessage` via a `Pull` call or a push
* delivery. It must not be populated by the publisher in a `Publish` call.
*
* ID of this message, assigned by the server when the message is published.
* Guaranteed to be unique within the topic. This value may be read by a
* subscriber that receives a `PubsubMessage` via a `Pull` call or a push
* delivery. It must not be populated by the publisher in a `Publish` call.
*
*
* string message_id = 3;
*
* @return The bytes for messageId.
*/
public com.google.protobuf.ByteString getMessageIdBytes() {
java.lang.Object ref = messageId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
messageId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* ID of this message, assigned by the server when the message is published.
* Guaranteed to be unique within the topic. This value may be read by a
* subscriber that receives a `PubsubMessage` via a `Pull` call or a push
* delivery. It must not be populated by the publisher in a `Publish` call.
*
*
* string message_id = 3;
*
* @param value The messageId to set.
* @return This builder for chaining.
*/
public Builder setMessageId(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
messageId_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* ID of this message, assigned by the server when the message is published.
* Guaranteed to be unique within the topic. This value may be read by a
* subscriber that receives a `PubsubMessage` via a `Pull` call or a push
* delivery. It must not be populated by the publisher in a `Publish` call.
*
* ID of this message, assigned by the server when the message is published.
* Guaranteed to be unique within the topic. This value may be read by a
* subscriber that receives a `PubsubMessage` via a `Pull` call or a push
* delivery. It must not be populated by the publisher in a `Publish` call.
*
*
* string message_id = 3;
*
* @param value The bytes for messageId to set.
* @return This builder for chaining.
*/
public Builder setMessageIdBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
messageId_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
private com.google.protobuf.Timestamp publishTime_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
publishTimeBuilder_;
/**
*
*
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
*
* .google.protobuf.Timestamp publish_time = 4;
*
* @return Whether the publishTime field is set.
*/
public boolean hasPublishTime() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
*
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
* The time at which the message was published, populated by the server when
* it receives the `Publish` call. It must not be populated by the
* publisher in a `Publish` call.
*
* Optional. If non-empty, identifies related messages for which publish order
* should be respected. If a `Subscription` has `enable_message_ordering` set
* to `true`, messages published with the same non-empty `ordering_key` value
* will be delivered to subscribers in the order in which they are received by
* the Pub/Sub system. All `PubsubMessage`s published in a given
* `PublishRequest` must specify the same `ordering_key` value. For more
* information, see [ordering
* messages](https://cloud.google.com/pubsub/docs/ordering).
*
* Optional. If non-empty, identifies related messages for which publish order
* should be respected. If a `Subscription` has `enable_message_ordering` set
* to `true`, messages published with the same non-empty `ordering_key` value
* will be delivered to subscribers in the order in which they are received by
* the Pub/Sub system. All `PubsubMessage`s published in a given
* `PublishRequest` must specify the same `ordering_key` value. For more
* information, see [ordering
* messages](https://cloud.google.com/pubsub/docs/ordering).
*
* Optional. If non-empty, identifies related messages for which publish order
* should be respected. If a `Subscription` has `enable_message_ordering` set
* to `true`, messages published with the same non-empty `ordering_key` value
* will be delivered to subscribers in the order in which they are received by
* the Pub/Sub system. All `PubsubMessage`s published in a given
* `PublishRequest` must specify the same `ordering_key` value. For more
* information, see [ordering
* messages](https://cloud.google.com/pubsub/docs/ordering).
*
*
* string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The orderingKey to set.
* @return This builder for chaining.
*/
public Builder setOrderingKey(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
orderingKey_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* Optional. If non-empty, identifies related messages for which publish order
* should be respected. If a `Subscription` has `enable_message_ordering` set
* to `true`, messages published with the same non-empty `ordering_key` value
* will be delivered to subscribers in the order in which they are received by
* the Pub/Sub system. All `PubsubMessage`s published in a given
* `PublishRequest` must specify the same `ordering_key` value. For more
* information, see [ordering
* messages](https://cloud.google.com/pubsub/docs/ordering).
*
* Optional. If non-empty, identifies related messages for which publish order
* should be respected. If a `Subscription` has `enable_message_ordering` set
* to `true`, messages published with the same non-empty `ordering_key` value
* will be delivered to subscribers in the order in which they are received by
* the Pub/Sub system. All `PubsubMessage`s published in a given
* `PublishRequest` must specify the same `ordering_key` value. For more
* information, see [ordering
* messages](https://cloud.google.com/pubsub/docs/ordering).
*
*
* string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The bytes for orderingKey to set.
* @return This builder for chaining.
*/
public Builder setOrderingKeyBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
orderingKey_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.pubsub.v1.PubsubMessage)
}
// @@protoc_insertion_point(class_scope:google.pubsub.v1.PubsubMessage)
private static final com.google.pubsub.v1.PubsubMessage DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.pubsub.v1.PubsubMessage();
}
public static com.google.pubsub.v1.PubsubMessage getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public PubsubMessage parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.pubsub.v1.PubsubMessage getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}