diff options
Diffstat (limited to 'src/main/java/org/traccar/handler/events')
-rw-r--r-- | src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java | 16 |
1 files changed, 6 insertions, 10 deletions
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); + }; } } |