Skip to content

Commit

Permalink
[grid] Making code Java 8 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Aug 20, 2020
1 parent a3ae711 commit 1bf4c5f
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions java/client/src/org/openqa/selenium/remote/tracing/Tags.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.AbstractMap.SimpleEntry;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Tags {
private static final Map<Integer, Status> STATUS_CODE_TO_TRACING_STATUS = Map.of(
401, Status.UNAUTHENTICATED,
404, Status.NOT_FOUND,
408, Status.DEADLINE_EXCEEDED,
429, Status.RESOURCE_EXHAUSTED,
499, Status.CANCELLED,
501, Status.UNIMPLEMENTED,
503, Status.UNAVAILABLE,
504, Status.DEADLINE_EXCEEDED);
private static final Map<Integer, Status> STATUS_CODE_TO_TRACING_STATUS = Stream.of(
new SimpleEntry<>(401, Status.UNAUTHENTICATED),
new SimpleEntry<>(404, Status.NOT_FOUND),
new SimpleEntry<>(408, Status.DEADLINE_EXCEEDED),
new SimpleEntry<>(429, Status.RESOURCE_EXHAUSTED),
new SimpleEntry<>(499, Status.CANCELLED),
new SimpleEntry<>(501, Status.UNIMPLEMENTED),
new SimpleEntry<>(503, Status.UNAVAILABLE),
new SimpleEntry<>(504, Status.DEADLINE_EXCEEDED)
).collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));

private Tags() {
// Utility class
Expand Down

0 comments on commit 1bf4c5f

Please sign in to comment.