From 2005fd55347816cf4a86b66ae97bc245f53f0bcd Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 6 Jul 2024 19:47:06 -0700 Subject: Update switch statements --- .../traccar/handler/events/MaintenanceEventHandler.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java') diff --git a/src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java b/src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java index 573ad4ad6..7fc6086aa 100644 --- a/src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java +++ b/src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java @@ -57,16 +57,12 @@ public class MaintenanceEventHandler extends BaseEventHandler { } private double getValue(Position position, String type) { - switch (type) { - case "serverTime": - return position.getServerTime().getTime(); - case "deviceTime": - return position.getDeviceTime().getTime(); - case "fixTime": - return position.getFixTime().getTime(); - default: - return position.getDouble(type); - } + return switch (type) { + case "serverTime" -> position.getServerTime().getTime(); + case "deviceTime" -> position.getDeviceTime().getTime(); + case "fixTime" -> position.getFixTime().getTime(); + default -> position.getDouble(type); + }; } } -- cgit v1.2.3