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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classExtendedConfigKey.Builder<T extends ExtendedConfigKey.Builder<?>>The builder for an ExtendedConfigKey. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DeprecatedInfoThe deprecation information.final SinceInfoThe version in which this attribute was added.Fields inherited from class org.apache.kafka.common.config.ConfigDef.ConfigKey
alternativeString, defaultValue, dependents, displayName, documentation, group, importance, internalConfig, name, orderInGroup, recommender, type, validator, width -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ExtendedConfigKey.Builder<?>>
ExtendedConfigKey.Builder<T>Creates a builder for the ExtendedConfigKey.static ExtendedConfigKeycreate(org.apache.kafka.common.config.ConfigDef.ConfigKey key) Creates an extended config key from a ConfigKey.final StringGets the deprecation message.final StringgetSince()Gets the value of since data element.final booleanGet the deprecated flag.final voidoverrideSince(SinceInfo.Builder builder) Sets since override.voidoverrideSince(Map<SinceInfo.OverrideRange, SinceInfo.Data> overrideMap) Sets the override from the Builder associated with the matching OverrideRange in the overrideMap.Methods inherited from class org.apache.kafka.common.config.ConfigDef.ConfigKey
hasDefault, type
-
Field Details
-
deprecated
The deprecation information. May benull. -
since
The version in which this attribute was added. May benull.
-
-
Method Details
-
create
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
Gets the deprecation message.- Returns:
- If the deprecation was set, returns
DeprecatedInfo.getDescription()otherwise return an empty string.
-
getSince
Gets the value of since data element.- Returns:
- the value of since if it was set, an empty string otherwise.
-
overrideSince
Sets since override. The builder must defineversionat a minimum. Any undefined values will be blank.- Parameters:
builder- the SinceInfo.Builder to define the override.
-
overrideSince
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:
trueif this key is deprecated,falseotherwise.
-
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.
-