aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/schedule
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/schedule
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/schedule')
-rw-r--r--src/main/java/org/traccar/schedule/TaskReports.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/main/java/org/traccar/schedule/TaskReports.java b/src/main/java/org/traccar/schedule/TaskReports.java
index 070fa9d2b..c57158cb9 100644
--- a/src/main/java/org/traccar/schedule/TaskReports.java
+++ b/src/main/java/org/traccar/schedule/TaskReports.java
@@ -116,34 +116,32 @@ public class TaskReports implements ScheduleTask {
for (User user : users) {
LogAction.report(user.getId(), true, report.getType(), from, to, deviceIds, groupIds);
switch (report.getType()) {
- case "events":
+ case "events" -> {
var eventsReportProvider = injector.getInstance(EventsReportProvider.class);
reportMailer.sendAsync(user.getId(), stream -> eventsReportProvider.getExcel(
stream, user.getId(), deviceIds, groupIds, List.of(), from, to));
- break;
- case "route":
+ }
+ case "route" -> {
var routeReportProvider = injector.getInstance(RouteReportProvider.class);
reportMailer.sendAsync(user.getId(), stream -> routeReportProvider.getExcel(
stream, user.getId(), deviceIds, groupIds, from, to));
- break;
- case "summary":
+ }
+ case "summary" -> {
var summaryReportProvider = injector.getInstance(SummaryReportProvider.class);
reportMailer.sendAsync(user.getId(), stream -> summaryReportProvider.getExcel(
stream, user.getId(), deviceIds, groupIds, from, to, false));
- break;
- case "trips":
+ }
+ case "trips" -> {
var tripsReportProvider = injector.getInstance(TripsReportProvider.class);
reportMailer.sendAsync(user.getId(), stream -> tripsReportProvider.getExcel(
stream, user.getId(), deviceIds, groupIds, from, to));
- break;
- case "stops":
+ }
+ case "stops" -> {
var stopsReportProvider = injector.getInstance(StopsReportProvider.class);
reportMailer.sendAsync(user.getId(), stream -> stopsReportProvider.getExcel(
stream, user.getId(), deviceIds, groupIds, from, to));
- break;
- default:
- LOGGER.warn("Unsupported report type {}", report.getType());
- break;
+ }
+ default -> LOGGER.warn("Unsupported report type {}", report.getType());
}
}
}