Skip to content

Commit 25de85b

Browse files
authored
Merge pull request #6 from Aiven-Open/aindriu-aiven/add-hide-doc-mechanism
add `CommonConfigDef.hide()` to toggle internal configuration option.
2 parents 937550d + 24f0a73 commit 25de85b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/io/aiven/commons/kafka/config/CommonConfigDef.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ protected Map<String, ConfigValue> multiValidate(final Map<String, ConfigValue>
5050
return valueMap;
5151
}
5252

53+
/**
54+
* Allows users to toggle certain config on and off in the documentation
55+
*
56+
* @param key The config key that you want to toggle hidden or unhidden in the documentation
57+
* @param state true hides the key from documentation false shows the config in the documentation
58+
*/
59+
protected void hide(String key, boolean state) {
60+
ExtendedConfigKey newKey =
61+
ExtendedConfigKey.Builder.unbuild(configKeys().get(key)).internalConfig(state).build();
62+
configKeys().put(newKey.name, newKey);
63+
}
64+
5365
@SuppressWarnings("PMD.AvoidCatchingGenericException")
5466
@Override
5567
public final List<ConfigValue> validate(final Map<String, String> props) {

0 commit comments

Comments
 (0)