aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler/events
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-07-06 19:47:06 -0700
committerAnton Tananaev <anton@traccar.org>2024-07-06 19:47:06 -0700
commit2005fd55347816cf4a86b66ae97bc245f53f0bcd (patch)
treea62fce83953b89530c968ef2c95828a80ff18cae /src/main/java/org/traccar/handler/events
parentb8390005722dd1cdb24d762797ef3f98ebc37755 (diff)
downloadtrackermap-server-2005fd55347816cf4a86b66ae97bc245f53f0bcd.tar.gz
trackermap-server-2005fd55347816cf4a86b66ae97bc245f53f0bcd.tar.bz2
trackermap-server-2005fd55347816cf4a86b66ae97bc245f53f0bcd.zip
Update switch statements
Diffstat (limited to 'src/main/java/org/traccar/handler/events')
-rw-r--r--src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java16
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);
+ };
}
}