Package io.aiven.commons.kafka.config
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
Builds Config Keys.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ObjectThe default value for the config key.The set of names forConfigDef.ConfigKeys that are dependent upon this key.protected StringThe display name for the key.protected StringThe documentation for this key.protected StringThe group key is a part of.protected org.apache.kafka.common.config.ConfigDef.ImportanceThe importance of this key.protected booleanThe internal config key for this builder.protected final StringThe name for the key.protected intThe order within the group.protected org.apache.kafka.common.config.ConfigDef.RecommenderThe recommender for this key.protected org.apache.kafka.common.config.ConfigDef.TypeThe type of the key.protected org.apache.kafka.common.config.ConfigDef.ValidatorThe validator (if any) for this key.protected org.apache.kafka.common.config.ConfigDef.WidthThe width of the input field for this config. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.kafka.common.config.ConfigDef.ConfigKeybuild()Builds a ConfigKey from the specified values.final TdefaultValue(Object defaultValue) Sets the default value.final TAdds a dependent to the list of dependents.final Tdependents(String... dependents) Add a collection of dependent names to the list of dependents.final Tdependents(Collection<String> dependents) Add a collection of dependent names to the list of dependents.final TdisplayName(String displayName) Sets the display name.final Tdocumentation(String documentation) Sets the documentation.protected StringGenerates the documentation.final TSets the name of the group.final Timportance(org.apache.kafka.common.config.ConfigDef.Importance importance) Sets the importance.final TinternalConfig(boolean internalConfig) Sets theinternalConfigflag.final TorderInGroup(int orderInGroup) Sets the order in the group.final Trecommender(org.apache.kafka.common.config.ConfigDef.Recommender recommender) Sets therecommender.protected Tself()Returns this cast to the actual builder type.final Ttype(org.apache.kafka.common.config.ConfigDef.Type type) Sets the data type.final Tvalidator(org.apache.kafka.common.config.ConfigDef.Validator validator) Sets the validator.final Twidth(org.apache.kafka.common.config.ConfigDef.Width width) Sets the width.
-
Field Details
-
name
The name for the key. -
type
protected org.apache.kafka.common.config.ConfigDef.Type typeThe type of the key. Defaults toConfigDef.Type.STRING. -
defaultValue
The default value for the config key. Defaults tonull. -
validator
protected org.apache.kafka.common.config.ConfigDef.Validator validatorThe validator (if any) for this key. May benull. -
importance
protected org.apache.kafka.common.config.ConfigDef.Importance importanceThe importance of this key. Defaults toConfigDef.Importance.MEDIUM -
documentation
The documentation for this key. Defaults to an empty string. -
group
The group key is a part of. Defaults tonull(no group). -
orderInGroup
protected int orderInGroupThe order within the group. Defaults to -1 (no order specified). -
width
protected org.apache.kafka.common.config.ConfigDef.Width widthThe width of the input field for this config. Defaults toConfigDef.Width.NONE -
displayName
The display name for the key. If not set, defaults to thename. -
dependents
The set of names forConfigDef.ConfigKeys that are dependent upon this key. -
recommender
protected org.apache.kafka.common.config.ConfigDef.Recommender recommenderThe recommender for this key. Defaults tonull(no recommender). -
internalConfig
protected boolean internalConfigThe internal config key for this builder. If set totruethe configuration will be an internal config. Defaults tofalse
-
-
Constructor Details
-
ConfigKeyBuilder
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
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
Returns this cast to the actual builder type.- Returns:
- this cast to the actual builder type.
-
type
Sets the data type.- Parameters:
type- the data type.- Returns:
- this
- See Also:
-
defaultValue
Sets the default value.- Parameters:
defaultValue- the default value.- Returns:
- this.
- See Also:
-
validator
Sets the validator.- Parameters:
validator- the validator.- Returns:
- this
- See Also:
-
importance
Sets the importance.- Parameters:
importance- the importance.- Returns:
- this
- See Also:
-
documentation
Sets the documentation.- Parameters:
documentation- the documentation.- Returns:
- this
- See Also:
-
group
Sets the name of the group.- Parameters:
group- the name of the group.- Returns:
- this.
- See Also:
-
orderInGroup
Sets the order in the group.- Parameters:
orderInGroup- the order in the group.- Returns:
- this
-
width
Sets the width.- Parameters:
width- the width.- Returns:
- this
- See Also:
-
displayName
Sets the display name.- Parameters:
displayName- the display name.- Returns:
- this
-
dependents
Add a collection of dependent names to the list of dependents.- Parameters:
dependents- the dependents to add.- Returns:
- this.
- See Also:
-
dependents
Add a collection of dependent names to the list of dependents.- Parameters:
dependents- the dependents to add.- Returns:
- this.
- See Also:
-
dependent
Adds a dependent to the list of dependents.- Parameters:
dependent- the dependent to add.- Returns:
- this.
- See Also:
-
recommender
Sets therecommender.- Parameters:
recommender- der.- Returns:
- this.
-
internalConfig
Sets theinternalConfigflag.- Parameters:
internalConfig- the value for the flag.- Returns:
- this.
-