You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/10/19 04:46:38 UTC

[GitHub] [kafka] chia7712 commented on a change in pull request #9369: KAFKA-4715: Ignore case of CompressionType and OffsetResetStrategy

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:
users@infra.apache.org