mimaison commented on code in PR #14515: URL: https://github.com/apache/kafka/pull/14515#discussion_r1350502430
########## clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java: ########## @@ -802,11 +802,63 @@ else if (value instanceof Class) } /** - * The config types + * The type for a configuration value */ public enum Type { - BOOLEAN, STRING, INT, SHORT, LONG, DOUBLE, LIST, CLASS, PASSWORD; + /** + * Used for boolean values. Values can be provided as a Boolean object or as a String with values + * <code>true</code> or <code>false</code> (this is not case-sensitive), otherwise a {@link ConfigException} is + * thrown. + */ + BOOLEAN, + /** + * Used for string values. Values must be provided as a String object, otherwise a {@link ConfigException} is + * thrown. + */ + STRING, + /** + * Used for numerical values within the Java Integer range. Values must be provided as a Integer object or as + * a String being a valid Integer value, otherwise a {@link ConfigException} is thrown. + */ + INT, + /** + * Used for numerical values within the Java Short range. Values must be provided as a Short object or as + * a String being a valid Short value, otherwise a {@link ConfigException} is thrown. + */ + SHORT, + /** + * Used for numerical values within the Java Long range. Values must be provided as a Long object, as an Integer + * object or as a String being a valid Long value, otherwise a {@link ConfigException} is thrown. + */ + LONG, + /** + * Used for numerical values within the Java Double range. Values must be provided as a Number object, as a + * Double object or as a String being a valid Double value, otherwise a {@link ConfigException} is thrown. + */ + DOUBLE, + /** + * Used for list values. Values must be provided as a List object, as a String object, otherwise a + * {@link ConfigException} is thrown. When the value is provided as a String it must use commas to separate the + * different entries (for example: <code>first-entry, second-entry</code>) and an empty String maps to an empty List. + */ + LIST, + /** + * Used for values that implement a Kafka interface. Values must be provided as a Class object or as a + * String object, otherwise a {@link ConfigException} is thrown. When the value is provided as a String it must + * be the binary name of the Class. + */ + CLASS, + /** + * Used for string values containing sensitive data such as a password or key. The values of configurations with + * of this type are not included in logs and instead replaced with "[hidden]". Values must be provided as a + * String object, otherwise a {@link ConfigException} is thrown. Review Comment: Technically you can also provide a `org.apache.kafka.common.config.types.Password` object but `Password` is not part of the public API so I omit that option. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org