hililiwei commented on code in PR #5967: URL: https://github.com/apache/iceberg/pull/5967#discussion_r1004302978
########## flink/v1.15/flink/src/main/java/org/apache/iceberg/flink/FlinkConfParser.java: ########## @@ -148,6 +155,34 @@ public String parseOptional() { } } + class EnumConfParser<E extends Enum<E>> extends ConfParser<EnumConfParser<E>, E> { + private E defaultValue; + private final Class<E> enumClass; + + EnumConfParser(Class<E> enumClass) { + this.enumClass = enumClass; + } + + @Override + protected EnumConfParser<E> self() { + return this; + } + + public EnumConfParser<E> defaultValue(E value) { + this.defaultValue = value; + return self(); + } + + public E parse() { + Preconditions.checkArgument(defaultValue != null, "Default value cannot be null"); + return parse(s -> Enum.valueOf(enumClass, s), defaultValue); Review Comment: Sorry, but convert which one? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org