chia7712 commented on a change in pull request #9369: URL: https://github.com/apache/kafka/pull/9369#discussion_r507452731
########## File path: clients/src/main/java/org/apache/kafka/clients/consumer/OffsetResetStrategy.java ########## @@ -16,6 +16,40 @@ */ package org.apache.kafka.clients.consumer; +import java.util.Locale; +import java.util.Objects; + +/** + * @see ConsumerConfig#AUTO_OFFSET_RESET_CONFIG + * @see ConsumerConfig#AUTO_OFFSET_RESET_DOC + */ public enum OffsetResetStrategy { - LATEST, EARLIEST, NONE + LATEST, EARLIEST, NONE; + + // Enums are singletons, this means that this conversion happens once the + // first time a variant is actually used, and never again. + private final String id = name().toLowerCase(Locale.ROOT); Review comment: Sorry that I can't catch your point here. Could you give more explanation to me? Is it different to ```Enum#toString```? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org