Class ExtendedConfigKey

java.lang.Object
org.apache.kafka.common.config.ConfigDef.ConfigKey
io.aiven.commons.kafka.config.ExtendedConfigKey

public class ExtendedConfigKey extends org.apache.kafka.common.config.ConfigDef.ConfigKey
An extended ConfigDef.ConfigKey that added deprecation information, and since data.
  • Field Details

    • deprecated

      public final DeprecatedInfo deprecated
      The deprecation information. May be null.
    • since

      public final SinceInfo since
      The version in which this attribute was added. May be null.
  • Method Details

    • create

      public static ExtendedConfigKey create(org.apache.kafka.common.config.ConfigDef.ConfigKey key)
      Creates an extended config key from a ConfigKey. If the key is already an ExtendedConfigKey it is simply returned.
      Parameters:
      key - The key to construct the ExtendedConfigKey from.
      Returns:
      An Extended config key.
    • getDeprecationMessage

      public final String getDeprecationMessage()
      Gets the deprecation message.
      Returns:
      If the deprecation was set, returns DeprecatedInfo.getDescription() otherwise return an empty string.
    • getSince

      public final String getSince()
      Gets the value of since data element.
      Returns:
      the value of since if it was set, an empty string otherwise.
    • overrideSince

      public final void overrideSince(SinceInfo.Builder builder)
      Sets since override. The builder must define version at a minimum. Any undefined values will be blank.
      Parameters:
      builder - the SinceInfo.Builder to define the override.
    • overrideSince

      public void overrideSince(Map<SinceInfo.OverrideRange,SinceInfo.Data> overrideMap)
      Sets the override from the Builder associated with the matching OverrideRange in the overrideMap. If multiple ranges match the last one in the map will be applied.
      Parameters:
      overrideMap - the map of OverrideRanges and builders to apply.
    • isDeprecated

      public final boolean isDeprecated()
      Get the deprecated flag.
      Returns:
      true if this key is deprecated, false otherwise.
    • builder

      public static <T extends ExtendedConfigKey.Builder<?>> ExtendedConfigKey.Builder<T> builder(String name)
      Creates a builder for the ExtendedConfigKey.
      Type Parameters:
      T - the type of the returned builder.
      Parameters:
      name - the name for the resulting key.
      Returns:
      the builder.