Class ConfigKeyBuilder<T extends ConfigKeyBuilder<?>>

java.lang.Object
io.aiven.commons.kafka.config.ConfigKeyBuilder<T>
Type Parameters:
T - The Class of the ConfigKeyBuilder.
Direct Known Subclasses:
ExtendedConfigKey.Builder

public class ConfigKeyBuilder<T extends ConfigKeyBuilder<?>> extends Object
Builds Config Keys.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Object
    The default value for the config key.
    protected Set<String>
    The set of names for ConfigDef.ConfigKeys that are dependent upon this key.
    protected String
    The display name for the key.
    protected String
    The documentation for this key.
    protected String
    The group key is a part of.
    protected org.apache.kafka.common.config.ConfigDef.Importance
    The importance of this key.
    protected boolean
    The internal config key for this builder.
    protected final String
    The name for the key.
    protected int
    The order within the group.
    protected org.apache.kafka.common.config.ConfigDef.Recommender
    The recommender for this key.
    protected org.apache.kafka.common.config.ConfigDef.Type
    The type of the key.
    protected org.apache.kafka.common.config.ConfigDef.Validator
    The validator (if any) for this key.
    protected org.apache.kafka.common.config.ConfigDef.Width
    The width of the input field for this config.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a ConfigKeyBuilder.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.kafka.common.config.ConfigDef.ConfigKey
    Builds a ConfigKey from the specified values.
    final T
    defaultValue(Object defaultValue)
    Sets the default value.
    final T
    dependent(String dependent)
    Adds a dependent to the list of dependents.
    final T
    dependents(String... dependents)
    Add a collection of dependent names to the list of dependents.
    final T
    Add a collection of dependent names to the list of dependents.
    final T
    displayName(String displayName)
    Sets the display name.
    final T
    documentation(String documentation)
    Sets the documentation.
    protected String
    Generates the documentation.
    final T
    group(String group)
    Sets the name of the group.
    final T
    importance(org.apache.kafka.common.config.ConfigDef.Importance importance)
    Sets the importance.
    final T
    internalConfig(boolean internalConfig)
    Sets the internalConfig flag.
    final T
    orderInGroup(int orderInGroup)
    Sets the order in the group.
    final T
    recommender(org.apache.kafka.common.config.ConfigDef.Recommender recommender)
    Sets the recommender.
    protected T
    Returns this cast to the actual builder type.
    final T
    type(org.apache.kafka.common.config.ConfigDef.Type type)
    Sets the data type.
    final T
    validator(org.apache.kafka.common.config.ConfigDef.Validator validator)
    Sets the validator.
    final T
    width(org.apache.kafka.common.config.ConfigDef.Width width)
    Sets the width.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • name

      protected final String name
      The name for the key.
    • type

      protected org.apache.kafka.common.config.ConfigDef.Type type
      The type of the key. Defaults to ConfigDef.Type.STRING.
    • defaultValue

      protected Object defaultValue
      The default value for the config key. Defaults to null.
    • validator

      protected org.apache.kafka.common.config.ConfigDef.Validator validator
      The validator (if any) for this key. May be null.
    • importance

      protected org.apache.kafka.common.config.ConfigDef.Importance importance
      The importance of this key. Defaults to ConfigDef.Importance.MEDIUM
    • documentation

      protected String documentation
      The documentation for this key. Defaults to an empty string.
    • group

      protected String group
      The group key is a part of. Defaults to null (no group).
    • orderInGroup

      protected int orderInGroup
      The order within the group. Defaults to -1 (no order specified).
    • width

      protected org.apache.kafka.common.config.ConfigDef.Width width
      The width of the input field for this config. Defaults to ConfigDef.Width.NONE
    • displayName

      protected String displayName
      The display name for the key. If not set, defaults to the name.
    • dependents

      protected Set<String> dependents
      The set of names for ConfigDef.ConfigKeys that are dependent upon this key.
    • recommender

      protected org.apache.kafka.common.config.ConfigDef.Recommender recommender
      The recommender for this key. Defaults to null (no recommender).
    • internalConfig

      protected boolean internalConfig
      The internal config key for this builder. If set to true the configuration will be an internal config. Defaults to false
  • Constructor Details

    • ConfigKeyBuilder

      public ConfigKeyBuilder(String name)
      Creates an instance of a ConfigKeyBuilder.
      Parameters:
      name - the name of the key being built.
  • Method Details

    • build

      public org.apache.kafka.common.config.ConfigDef.ConfigKey build()
      Builds a ConfigKey from the specified values.
      Returns:
      a ConfigKey from the specified values.
    • generateDocumentation

      protected String generateDocumentation()
      Generates the documentation. This is an extension point for ConfigKey builders to modify the documentation. For example adding deprecation information, or interactions with other keys in the configuration.
      Returns:
      the documentation for the component.
    • self

      protected T self()
      Returns this cast to the actual builder type.
      Returns:
      this cast to the actual builder type.
    • type

      public final T type(org.apache.kafka.common.config.ConfigDef.Type type)
      Sets the data type.
      Parameters:
      type - the data type.
      Returns:
      this
      See Also:
    • defaultValue

      public final T defaultValue(Object defaultValue)
      Sets the default value.
      Parameters:
      defaultValue - the default value.
      Returns:
      this.
      See Also:
    • validator

      public final T validator(org.apache.kafka.common.config.ConfigDef.Validator validator)
      Sets the validator.
      Parameters:
      validator - the validator.
      Returns:
      this
      See Also:
    • importance

      public final T importance(org.apache.kafka.common.config.ConfigDef.Importance importance)
      Sets the importance.
      Parameters:
      importance - the importance.
      Returns:
      this
      See Also:
    • documentation

      public final T documentation(String documentation)
      Sets the documentation.
      Parameters:
      documentation - the documentation.
      Returns:
      this
      See Also:
    • group

      public final T group(String group)
      Sets the name of the group.
      Parameters:
      group - the name of the group.
      Returns:
      this.
      See Also:
    • orderInGroup

      public final T orderInGroup(int orderInGroup)
      Sets the order in the group.
      Parameters:
      orderInGroup - the order in the group.
      Returns:
      this
    • width

      public final T width(org.apache.kafka.common.config.ConfigDef.Width width)
      Sets the width.
      Parameters:
      width - the width.
      Returns:
      this
      See Also:
    • displayName

      public final T displayName(String displayName)
      Sets the display name.
      Parameters:
      displayName - the display name.
      Returns:
      this
    • dependents

      public final T dependents(String... dependents)
      Add a collection of dependent names to the list of dependents.
      Parameters:
      dependents - the dependents to add.
      Returns:
      this.
      See Also:
    • dependents

      public final T dependents(Collection<String> dependents)
      Add a collection of dependent names to the list of dependents.
      Parameters:
      dependents - the dependents to add.
      Returns:
      this.
      See Also:
    • dependent

      public final T dependent(String dependent)
      Adds a dependent to the list of dependents.
      Parameters:
      dependent - the dependent to add.
      Returns:
      this.
      See Also:
    • recommender

      public final T recommender(org.apache.kafka.common.config.ConfigDef.Recommender recommender)
      Sets the recommender.
      Parameters:
      recommender - der.
      Returns:
      this.
    • internalConfig

      public final T internalConfig(boolean internalConfig)
      Sets the internalConfig flag.
      Parameters:
      internalConfig - the value for the flag.
      Returns:
      this.