Class Topic.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Topic.Builder>
com.google.cloud.managedkafka.v1.Topic.Builder
All Implemented Interfaces:
TopicOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Topic

public static final class Topic.Builder extends com.google.protobuf.GeneratedMessage.Builder<Topic.Builder> implements TopicOrBuilder
 A Kafka topic in a given cluster.
 
Protobuf type google.cloud.managedkafka.v1.Topic
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<Topic.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<Topic.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Topic.Builder>
    • clear

      public Topic.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<Topic.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Topic.Builder>
    • getDefaultInstanceForType

      public Topic getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Topic build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Topic buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public Topic.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Topic.Builder>
    • mergeFrom

      public Topic.Builder mergeFrom(Topic other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<Topic.Builder>
    • mergeFrom

      public Topic.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Topic.Builder>
      Throws:
      IOException
    • getName

      public String getName()
       Identifier. The name of the topic. The `topic` segment is used when
       connecting directly to the cluster. Structured like:
       projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getName in interface TopicOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Identifier. The name of the topic. The `topic` segment is used when
       connecting directly to the cluster. Structured like:
       projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getNameBytes in interface TopicOrBuilder
      Returns:
      The bytes for name.
    • setName

      public Topic.Builder setName(String value)
       Identifier. The name of the topic. The `topic` segment is used when
       connecting directly to the cluster. Structured like:
       projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public Topic.Builder clearName()
       Identifier. The name of the topic. The `topic` segment is used when
       connecting directly to the cluster. Structured like:
       projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Returns:
      This builder for chaining.
    • setNameBytes

      public Topic.Builder setNameBytes(com.google.protobuf.ByteString value)
       Identifier. The name of the topic. The `topic` segment is used when
       connecting directly to the cluster. Structured like:
       projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getPartitionCount

      public int getPartitionCount()
       Required. The number of partitions this topic has. The partition count can
       only be increased, not decreased. Please note that if partitions are
       increased for a topic that has a key, the partitioning logic or the
       ordering of the messages will be affected.
       
      int32 partition_count = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getPartitionCount in interface TopicOrBuilder
      Returns:
      The partitionCount.
    • setPartitionCount

      public Topic.Builder setPartitionCount(int value)
       Required. The number of partitions this topic has. The partition count can
       only be increased, not decreased. Please note that if partitions are
       increased for a topic that has a key, the partitioning logic or the
       ordering of the messages will be affected.
       
      int32 partition_count = 2 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The partitionCount to set.
      Returns:
      This builder for chaining.
    • clearPartitionCount

      public Topic.Builder clearPartitionCount()
       Required. The number of partitions this topic has. The partition count can
       only be increased, not decreased. Please note that if partitions are
       increased for a topic that has a key, the partitioning logic or the
       ordering of the messages will be affected.
       
      int32 partition_count = 2 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • getReplicationFactor

      public int getReplicationFactor()
       Required. Immutable. The number of replicas of each partition. A
       replication factor of 3 is recommended for high availability.
       
      int32 replication_factor = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getReplicationFactor in interface TopicOrBuilder
      Returns:
      The replicationFactor.
    • setReplicationFactor

      public Topic.Builder setReplicationFactor(int value)
       Required. Immutable. The number of replicas of each partition. A
       replication factor of 3 is recommended for high availability.
       
      int32 replication_factor = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Parameters:
      value - The replicationFactor to set.
      Returns:
      This builder for chaining.
    • clearReplicationFactor

      public Topic.Builder clearReplicationFactor()
       Required. Immutable. The number of replicas of each partition. A
       replication factor of 3 is recommended for high availability.
       
      int32 replication_factor = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Returns:
      This builder for chaining.
    • getConfigsCount

      public int getConfigsCount()
      Description copied from interface: TopicOrBuilder
       Optional. Configurations for the topic that are overridden from the cluster
       defaults. The key of the map is a Kafka topic property name, for example:
       `cleanup.policy`, `compression.type`.
       
      map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getConfigsCount in interface TopicOrBuilder
    • containsConfigs

      public boolean containsConfigs(String key)
       Optional. Configurations for the topic that are overridden from the cluster
       defaults. The key of the map is a Kafka topic property name, for example:
       `cleanup.policy`, `compression.type`.
       
      map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      containsConfigs in interface TopicOrBuilder
    • getConfigs

      @Deprecated public Map<String,String> getConfigs()
      Deprecated.
      Use getConfigsMap() instead.
      Specified by:
      getConfigs in interface TopicOrBuilder
    • getConfigsMap

      public Map<String,String> getConfigsMap()
       Optional. Configurations for the topic that are overridden from the cluster
       defaults. The key of the map is a Kafka topic property name, for example:
       `cleanup.policy`, `compression.type`.
       
      map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getConfigsMap in interface TopicOrBuilder
    • getConfigsOrDefault

      public String getConfigsOrDefault(String key, String defaultValue)
       Optional. Configurations for the topic that are overridden from the cluster
       defaults. The key of the map is a Kafka topic property name, for example:
       `cleanup.policy`, `compression.type`.
       
      map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getConfigsOrDefault in interface TopicOrBuilder
    • getConfigsOrThrow

      public String getConfigsOrThrow(String key)
       Optional. Configurations for the topic that are overridden from the cluster
       defaults. The key of the map is a Kafka topic property name, for example:
       `cleanup.policy`, `compression.type`.
       
      map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getConfigsOrThrow in interface TopicOrBuilder
    • clearConfigs

      public Topic.Builder clearConfigs()
    • removeConfigs

      public Topic.Builder removeConfigs(String key)
       Optional. Configurations for the topic that are overridden from the cluster
       defaults. The key of the map is a Kafka topic property name, for example:
       `cleanup.policy`, `compression.type`.
       
      map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
    • getMutableConfigs

      @Deprecated public Map<String,String> getMutableConfigs()
      Deprecated.
      Use alternate mutation accessors instead.
    • putConfigs

      public Topic.Builder putConfigs(String key, String value)
       Optional. Configurations for the topic that are overridden from the cluster
       defaults. The key of the map is a Kafka topic property name, for example:
       `cleanup.policy`, `compression.type`.
       
      map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
    • putAllConfigs

      public Topic.Builder putAllConfigs(Map<String,String> values)
       Optional. Configurations for the topic that are overridden from the cluster
       defaults. The key of the map is a Kafka topic property name, for example:
       `cleanup.policy`, `compression.type`.
       
      map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];