Skip to content

Commit e09fa14

Browse files
committed
Use ofEntries for increased clarity
1 parent e15984b commit e09fa14

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

modules/ingest-ecs/src/main/java/org/elasticsearch/ingest/ecs/EcsNamespaceProcessor.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import java.util.Map;
2222
import java.util.Set;
2323

24+
import static java.util.Map.entry;
25+
2426
/**
2527
* This processor is responsible for transforming non-OpenTelemetry-compliant documents into a namespaced flavor of ECS
2628
* that makes them compatible with OpenTelemetry.
@@ -43,15 +45,11 @@ public class EcsNamespaceProcessor extends AbstractProcessor {
4345
/**
4446
* Mapping of ECS field names to their corresponding OpenTelemetry-compatible counterparts.
4547
*/
46-
private static final Map<String, String> RENAME_KEYS = Map.of(
47-
"span.id",
48-
"span_id",
49-
"message",
50-
"body.text",
51-
"log.level",
52-
"severity_text",
53-
"trace.id",
54-
"trace_id"
48+
private static final Map<String, String> RENAME_KEYS = Map.ofEntries(
49+
entry("span.id", "span_id"),
50+
entry("message", "body.text"),
51+
entry("log.level", "severity_text"),
52+
entry("trace.id", "trace_id")
5553
);
5654

5755
/**

0 commit comments

Comments
 (0)