public static final class Topic.Builder extends GeneratedMessageV3.Builder<Topic.Builder> implements TopicOrBuilder
A topic resource.
Protobuf type google.pubsub.v1.Topic
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > Topic.BuilderImplements
TopicOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Type | Description |
Descriptor |
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Topic.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
Topic.Builder |
build()
public Topic build()
Type | Description |
Topic |
buildPartial()
public Topic buildPartial()
Type | Description |
Topic |
clear()
public Topic.Builder clear()
Type | Description |
Topic.Builder |
clearField(Descriptors.FieldDescriptor field)
public Topic.Builder clearField(Descriptors.FieldDescriptor field)
Name | Description |
field | FieldDescriptor |
Type | Description |
Topic.Builder |
clearKmsKeyName()
public Topic.Builder clearKmsKeyName()
The resource name of the Cloud KMS CryptoKey to be used to protect access
to messages published on this topic.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
.
string kms_key_name = 5;
Type | Description |
Topic.Builder | This builder for chaining. |
clearLabels()
public Topic.Builder clearLabels()
Type | Description |
Topic.Builder |
clearMessageRetentionDuration()
public Topic.Builder clearMessageRetentionDuration()
Indicates the minimum duration to retain a message after it is published to
the topic. If this field is set, messages published to the topic in the
last message_retention_duration
are always available to subscribers. For
instance, it allows any attached subscription to seek to a
timestamp
that is up to message_retention_duration
in the past. If this field is
not set, message retention is controlled by settings on individual
subscriptions. Cannot be more than 7 days or less than 10 minutes.
.google.protobuf.Duration message_retention_duration = 8;
Type | Description |
Topic.Builder |
clearMessageStoragePolicy()
public Topic.Builder clearMessageStoragePolicy()
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;
Type | Description |
Topic.Builder |
clearName()
public Topic.Builder clearName()
Required. The name of the topic. It must have the format
"projects/{project}/topics/{topic}"
. {topic}
must start with a letter,
and contain only letters ([A-Za-z]
), numbers ([0-9]
), dashes (-
),
underscores (_
), periods (.
), tildes (~
), plus (+
) or percent
signs (%
). It must be between 3 and 255 characters in length, and it
must not start with "goog"
.
string name = 1 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
Topic.Builder | This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public Topic.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Name | Description |
oneof | OneofDescriptor |
Type | Description |
Topic.Builder |
clearSatisfiesPzs()
public Topic.Builder clearSatisfiesPzs()
Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
bool satisfies_pzs = 7;
Type | Description |
Topic.Builder | This builder for chaining. |
clearSchemaSettings()
public Topic.Builder clearSchemaSettings()
Settings for validating messages published against a schema.
.google.pubsub.v1.SchemaSettings schema_settings = 6;
Type | Description |
Topic.Builder |
clone()
public Topic.Builder clone()
Type | Description |
Topic.Builder |
containsLabels(String key)
public boolean containsLabels(String key)
See Creating and managing labels.
map<string, string> labels = 2;
Name | Description |
key | String |
Type | Description |
boolean |
getDefaultInstanceForType()
public Topic getDefaultInstanceForType()
Type | Description |
Topic |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Type | Description |
Descriptor |
getKmsKeyName()
public String getKmsKeyName()
The resource name of the Cloud KMS CryptoKey to be used to protect access
to messages published on this topic.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
.
string kms_key_name = 5;
Type | Description |
String | The kmsKeyName. |
getKmsKeyNameBytes()
public ByteString getKmsKeyNameBytes()
The resource name of the Cloud KMS CryptoKey to be used to protect access
to messages published on this topic.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
.
string kms_key_name = 5;
Type | Description |
ByteString | The bytes for kmsKeyName. |
getLabels()
public Map<String,String> getLabels()
Use #getLabelsMap() instead.
Type | Description |
Map<String,String> |
getLabelsCount()
public int getLabelsCount()
See Creating and managing labels.
map<string, string> labels = 2;
Type | Description |
int |
getLabelsMap()
public Map<String,String> getLabelsMap()
See Creating and managing labels.
map<string, string> labels = 2;
Type | Description |
Map<String,String> |
getLabelsOrDefault(String key, String defaultValue)
public String getLabelsOrDefault(String key, String defaultValue)
See Creating and managing labels.
map<string, string> labels = 2;
Name | Description |
key | String |
defaultValue | String |
Type | Description |
String |
getLabelsOrThrow(String key)
public String getLabelsOrThrow(String key)
See Creating and managing labels.
map<string, string> labels = 2;
Name | Description |
key | String |
Type | Description |
String |
getMessageRetentionDuration()
public Duration getMessageRetentionDuration()
Indicates the minimum duration to retain a message after it is published to
the topic. If this field is set, messages published to the topic in the
last message_retention_duration
are always available to subscribers. For
instance, it allows any attached subscription to seek to a
timestamp
that is up to message_retention_duration
in the past. If this field is
not set, message retention is controlled by settings on individual
subscriptions. Cannot be more than 7 days or less than 10 minutes.
.google.protobuf.Duration message_retention_duration = 8;
Type | Description |
Duration | The messageRetentionDuration. |
getMessageRetentionDurationBuilder()
public Duration.Builder getMessageRetentionDurationBuilder()
Indicates the minimum duration to retain a message after it is published to
the topic. If this field is set, messages published to the topic in the
last message_retention_duration
are always available to subscribers. For
instance, it allows any attached subscription to seek to a
timestamp
that is up to message_retention_duration
in the past. If this field is
not set, message retention is controlled by settings on individual
subscriptions. Cannot be more than 7 days or less than 10 minutes.
.google.protobuf.Duration message_retention_duration = 8;
Type | Description |
Builder |
getMessageRetentionDurationOrBuilder()
public DurationOrBuilder getMessageRetentionDurationOrBuilder()
Indicates the minimum duration to retain a message after it is published to
the topic. If this field is set, messages published to the topic in the
last message_retention_duration
are always available to subscribers. For
instance, it allows any attached subscription to seek to a
timestamp
that is up to message_retention_duration
in the past. If this field is
not set, message retention is controlled by settings on individual
subscriptions. Cannot be more than 7 days or less than 10 minutes.
.google.protobuf.Duration message_retention_duration = 8;
Type | Description |
DurationOrBuilder |
getMessageStoragePolicy()
public MessageStoragePolicy getMessageStoragePolicy()
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;
Type | Description |
MessageStoragePolicy | The messageStoragePolicy. |
getMessageStoragePolicyBuilder()
public MessageStoragePolicy.Builder getMessageStoragePolicyBuilder()
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;
Type | Description |
MessageStoragePolicy.Builder |
getMessageStoragePolicyOrBuilder()
public MessageStoragePolicyOrBuilder getMessageStoragePolicyOrBuilder()
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;
Type | Description |
MessageStoragePolicyOrBuilder |
getMutableLabels()
public Map<String,String> getMutableLabels()
Use alternate mutation accessors instead.
Type | Description |
Map<String,String> |
getName()
public String getName()
Required. The name of the topic. It must have the format
"projects/{project}/topics/{topic}"
. {topic}
must start with a letter,
and contain only letters ([A-Za-z]
), numbers ([0-9]
), dashes (-
),
underscores (_
), periods (.
), tildes (~
), plus (+
) or percent
signs (%
). It must be between 3 and 255 characters in length, and it
must not start with "goog"
.
string name = 1 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
String | The name. |
getNameBytes()
public ByteString getNameBytes()
Required. The name of the topic. It must have the format
"projects/{project}/topics/{topic}"
. {topic}
must start with a letter,
and contain only letters ([A-Za-z]
), numbers ([0-9]
), dashes (-
),
underscores (_
), periods (.
), tildes (~
), plus (+
) or percent
signs (%
). It must be between 3 and 255 characters in length, and it
must not start with "goog"
.
string name = 1 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
ByteString | The bytes for name. |
getSatisfiesPzs()
public boolean getSatisfiesPzs()
Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
bool satisfies_pzs = 7;
Type | Description |
boolean | The satisfiesPzs. |
getSchemaSettings()
public SchemaSettings getSchemaSettings()
Settings for validating messages published against a schema.
.google.pubsub.v1.SchemaSettings schema_settings = 6;
Type | Description |
SchemaSettings | The schemaSettings. |
getSchemaSettingsBuilder()
public SchemaSettings.Builder getSchemaSettingsBuilder()
Settings for validating messages published against a schema.
.google.pubsub.v1.SchemaSettings schema_settings = 6;
Type | Description |
SchemaSettings.Builder |
getSchemaSettingsOrBuilder()
public SchemaSettingsOrBuilder getSchemaSettingsOrBuilder()
Settings for validating messages published against a schema.
.google.pubsub.v1.SchemaSettings schema_settings = 6;
Type | Description |
SchemaSettingsOrBuilder |
hasMessageRetentionDuration()
public boolean hasMessageRetentionDuration()
Indicates the minimum duration to retain a message after it is published to
the topic. If this field is set, messages published to the topic in the
last message_retention_duration
are always available to subscribers. For
instance, it allows any attached subscription to seek to a
timestamp
that is up to message_retention_duration
in the past. If this field is
not set, message retention is controlled by settings on individual
subscriptions. Cannot be more than 7 days or less than 10 minutes.
.google.protobuf.Duration message_retention_duration = 8;
Type | Description |
boolean | Whether the messageRetentionDuration field is set. |
hasMessageStoragePolicy()
public boolean hasMessageStoragePolicy()
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;
Type | Description |
boolean | Whether the messageStoragePolicy field is set. |
hasSchemaSettings()
public boolean hasSchemaSettings()
Settings for validating messages published against a schema.
.google.pubsub.v1.SchemaSettings schema_settings = 6;
Type | Description |
boolean | Whether the schemaSettings field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Type | Description |
FieldAccessorTable |
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Name | Description |
number | int |
Type | Description |
MapField |
internalGetMutableMapField(int number)
protected MapField internalGetMutableMapField(int number)
Name | Description |
number | int |
Type | Description |
MapField |
isInitialized()
public final boolean isInitialized()
Type | Description |
boolean |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public Topic.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Topic.Builder |
Type | Description |
IOException |
mergeFrom(Message other)
public Topic.Builder mergeFrom(Message other)
Name | Description |
other | Message |
Type | Description |
Topic.Builder |
mergeFrom(Topic other)
public Topic.Builder mergeFrom(Topic other)
Name | Description |
other | Topic |
Type | Description |
Topic.Builder |
mergeMessageRetentionDuration(Duration value)
public Topic.Builder mergeMessageRetentionDuration(Duration value)
Indicates the minimum duration to retain a message after it is published to
the topic. If this field is set, messages published to the topic in the
last message_retention_duration
are always available to subscribers. For
instance, it allows any attached subscription to seek to a
timestamp
that is up to message_retention_duration
in the past. If this field is
not set, message retention is controlled by settings on individual
subscriptions. Cannot be more than 7 days or less than 10 minutes.
.google.protobuf.Duration message_retention_duration = 8;
Name | Description |
value | Duration |
Type | Description |
Topic.Builder |
mergeMessageStoragePolicy(MessageStoragePolicy value)
public Topic.Builder mergeMessageStoragePolicy(MessageStoragePolicy value)
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;
Name | Description |
value | MessageStoragePolicy |
Type | Description |
Topic.Builder |
mergeSchemaSettings(SchemaSettings value)
public Topic.Builder mergeSchemaSettings(SchemaSettings value)
Settings for validating messages published against a schema.
.google.pubsub.v1.SchemaSettings schema_settings = 6;
Name | Description |
value | SchemaSettings |
Type | Description |
Topic.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Topic.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
Topic.Builder |
putAllLabels(Map<String,String> values)
public Topic.Builder putAllLabels(Map<String,String> values)
See Creating and managing labels.
map<string, string> labels = 2;
Name | Description |
values | Map<String,String> |
Type | Description |
Topic.Builder |
putLabels(String key, String value)
public Topic.Builder putLabels(String key, String value)
See Creating and managing labels.
map<string, string> labels = 2;
Name | Description |
key | String |
value | String |
Type | Description |
Topic.Builder |
removeLabels(String key)
public Topic.Builder removeLabels(String key)
See Creating and managing labels.
map<string, string> labels = 2;
Name | Description |
key | String |
Type | Description |
Topic.Builder |
setField(Descriptors.FieldDescriptor field, Object value)
public Topic.Builder setField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
Topic.Builder |
setKmsKeyName(String value)
public Topic.Builder setKmsKeyName(String value)
The resource name of the Cloud KMS CryptoKey to be used to protect access
to messages published on this topic.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
.
string kms_key_name = 5;
Name | Description |
value | String The kmsKeyName to set. |
Type | Description |
Topic.Builder | This builder for chaining. |
setKmsKeyNameBytes(ByteString value)
public Topic.Builder setKmsKeyNameBytes(ByteString value)
The resource name of the Cloud KMS CryptoKey to be used to protect access
to messages published on this topic.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
.
string kms_key_name = 5;
Name | Description |
value | ByteString The bytes for kmsKeyName to set. |
Type | Description |
Topic.Builder | This builder for chaining. |
setMessageRetentionDuration(Duration value)
public Topic.Builder setMessageRetentionDuration(Duration value)
Indicates the minimum duration to retain a message after it is published to
the topic. If this field is set, messages published to the topic in the
last message_retention_duration
are always available to subscribers. For
instance, it allows any attached subscription to seek to a
timestamp
that is up to message_retention_duration
in the past. If this field is
not set, message retention is controlled by settings on individual
subscriptions. Cannot be more than 7 days or less than 10 minutes.
.google.protobuf.Duration message_retention_duration = 8;
Name | Description |
value | Duration |
Type | Description |
Topic.Builder |
setMessageRetentionDuration(Duration.Builder builderForValue)
public Topic.Builder setMessageRetentionDuration(Duration.Builder builderForValue)
Indicates the minimum duration to retain a message after it is published to
the topic. If this field is set, messages published to the topic in the
last message_retention_duration
are always available to subscribers. For
instance, it allows any attached subscription to seek to a
timestamp
that is up to message_retention_duration
in the past. If this field is
not set, message retention is controlled by settings on individual
subscriptions. Cannot be more than 7 days or less than 10 minutes.
.google.protobuf.Duration message_retention_duration = 8;
Name | Description |
builderForValue | Builder |
Type | Description |
Topic.Builder |
setMessageStoragePolicy(MessageStoragePolicy value)
public Topic.Builder setMessageStoragePolicy(MessageStoragePolicy value)
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;
Name | Description |
value | MessageStoragePolicy |
Type | Description |
Topic.Builder |
setMessageStoragePolicy(MessageStoragePolicy.Builder builderForValue)
public Topic.Builder setMessageStoragePolicy(MessageStoragePolicy.Builder builderForValue)
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
.google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3;
Name | Description |
builderForValue | MessageStoragePolicy.Builder |
Type | Description |
Topic.Builder |
setName(String value)
public Topic.Builder setName(String value)
Required. The name of the topic. It must have the format
"projects/{project}/topics/{topic}"
. {topic}
must start with a letter,
and contain only letters ([A-Za-z]
), numbers ([0-9]
), dashes (-
),
underscores (_
), periods (.
), tildes (~
), plus (+
) or percent
signs (%
). It must be between 3 and 255 characters in length, and it
must not start with "goog"
.
string name = 1 [(.google.api.field_behavior) = REQUIRED];
Name | Description |
value | String The name to set. |
Type | Description |
Topic.Builder | This builder for chaining. |
setNameBytes(ByteString value)
public Topic.Builder setNameBytes(ByteString value)
Required. The name of the topic. It must have the format
"projects/{project}/topics/{topic}"
. {topic}
must start with a letter,
and contain only letters ([A-Za-z]
), numbers ([0-9]
), dashes (-
),
underscores (_
), periods (.
), tildes (~
), plus (+
) or percent
signs (%
). It must be between 3 and 255 characters in length, and it
must not start with "goog"
.
string name = 1 [(.google.api.field_behavior) = REQUIRED];
Name | Description |
value | ByteString The bytes for name to set. |
Type | Description |
Topic.Builder | This builder for chaining. |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Topic.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Name | Description |
field | FieldDescriptor |
index | int |
value | Object |
Type | Description |
Topic.Builder |
setSatisfiesPzs(boolean value)
public Topic.Builder setSatisfiesPzs(boolean value)
Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
bool satisfies_pzs = 7;
Name | Description |
value | boolean The satisfiesPzs to set. |
Type | Description |
Topic.Builder | This builder for chaining. |
setSchemaSettings(SchemaSettings value)
public Topic.Builder setSchemaSettings(SchemaSettings value)
Settings for validating messages published against a schema.
.google.pubsub.v1.SchemaSettings schema_settings = 6;
Name | Description |
value | SchemaSettings |
Type | Description |
Topic.Builder |
setSchemaSettings(SchemaSettings.Builder builderForValue)
public Topic.Builder setSchemaSettings(SchemaSettings.Builder builderForValue)
Settings for validating messages published against a schema.
.google.pubsub.v1.SchemaSettings schema_settings = 6;
Name | Description |
builderForValue | SchemaSettings.Builder |
Type | Description |
Topic.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final Topic.Builder setUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
Topic.Builder |