aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/NavigilProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-07-07 07:33:16 -0700
committerAnton Tananaev <anton@traccar.org>2024-07-07 07:33:16 -0700
commitd0536ccbc1b7234784c5e48288bbac00a60ef821 (patch)
tree29ba8e1349eb9a5990f564edad7ddc7b5e24d7f7 /src/main/java/org/traccar/protocol/NavigilProtocolDecoder.java
parent864872b2df3e26c94d3a5826f4df504de3cf6c62 (diff)
downloadtrackermap-server-d0536ccbc1b7234784c5e48288bbac00a60ef821.tar.gz
trackermap-server-d0536ccbc1b7234784c5e48288bbac00a60ef821.tar.bz2
trackermap-server-d0536ccbc1b7234784c5e48288bbac00a60ef821.zip
Update switch statements
Diffstat (limited to 'src/main/java/org/traccar/protocol/NavigilProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/NavigilProtocolDecoder.java25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/main/java/org/traccar/protocol/NavigilProtocolDecoder.java b/src/main/java/org/traccar/protocol/NavigilProtocolDecoder.java
index 6dadbc559..5d3bae8e8 100644
--- a/src/main/java/org/traccar/protocol/NavigilProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/NavigilProtocolDecoder.java
@@ -287,22 +287,15 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
sendAcknowledgment(channel, sequenceNumber);
}
- switch (messageId) {
- case MSG_UNIT_REPORT:
- return parseUnitReport(deviceSession, buf, sequenceNumber);
- case MSG_TG2_REPORT:
- return parseTg2Report(deviceSession, buf, sequenceNumber);
- case MSG_POSITION_REPORT:
- return parsePositionReport(deviceSession, buf, sequenceNumber, timestamp);
- case MSG_POSITION_REPORT_2:
- return parsePositionReport2(deviceSession, buf, sequenceNumber, timestamp);
- case MSG_SNAPSHOT4:
- return parseSnapshot4(deviceSession, buf, sequenceNumber);
- case MSG_TRACKING_DATA:
- return parseTrackingData(deviceSession, buf, sequenceNumber, timestamp);
- default:
- return null;
- }
+ return switch (messageId) {
+ case MSG_UNIT_REPORT -> parseUnitReport(deviceSession, buf, sequenceNumber);
+ case MSG_TG2_REPORT -> parseTg2Report(deviceSession, buf, sequenceNumber);
+ case MSG_POSITION_REPORT -> parsePositionReport(deviceSession, buf, sequenceNumber, timestamp);
+ case MSG_POSITION_REPORT_2 -> parsePositionReport2(deviceSession, buf, sequenceNumber, timestamp);
+ case MSG_SNAPSHOT4 -> parseSnapshot4(deviceSession, buf, sequenceNumber);
+ case MSG_TRACKING_DATA -> parseTrackingData(deviceSession, buf, sequenceNumber, timestamp);
+ default -> null;
+ };
}
}