From 25901f4e9e3d99baf6f216e66faccd96b22644ad Mon Sep 17 00:00:00 2001 From: Kartik Ganesh Date: Fri, 22 Apr 2022 15:42:51 -0700 Subject: [PATCH] Simplifying the code in ReplicationType I forgot that valueOf parses the name of the enum and not its value. Signed-off-by: Kartik Ganesh --- .../replication/common/ReplicationType.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java index d2363682eadef..98d68d67ba5e3 100644 --- a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java +++ b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java @@ -8,17 +8,14 @@ package org.opensearch.indices.replication.common; +/** + * Enumerates the types of replication strategies supported by OpenSearch. + * For more information, see https://github.com/opensearch-project/OpenSearch/issues/1694 + */ public enum ReplicationType { - DOCUMENT("document"), - - SEGMENT("segment"); - - private final String value; - - ReplicationType(String replicationType) { - this.value = replicationType; - } + DOCUMENT, + SEGMENT; public static ReplicationType parseString(String replicationType) { try { @@ -30,9 +27,4 @@ public static ReplicationType parseString(String replicationType) { return DOCUMENT; } } - - @Override - public String toString() { - return value; - } }