aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2024-08-03 20:52:00 -0600
committerIván Ávalos <avalos@disroot.org>2024-08-03 20:52:00 -0600
commit55f6d92c09a5b1d8566b53633d07be3d31010d3b (patch)
treeb86bed801b0bbadb72c7e839296dae1d28b12bbb /src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java
parentc04ad7d48331253c095fc123ded1b00f6ff871d3 (diff)
parent2788174193def918a3a1a5be3bbed24c9613323f (diff)
downloadtrackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.gz
trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.bz2
trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.zip
Merge tag 'tags/v6.3'
Diffstat (limited to 'src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java41
1 files changed, 15 insertions, 26 deletions
diff --git a/src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java b/src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java
index b0a5411f7..a0c059898 100644
--- a/src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java
@@ -40,35 +40,24 @@ public class B2316ProtocolDecoder extends BaseProtocolDecoder {
}
private String decodeAlarm(int value) {
- switch (value) {
- case 1:
- return Position.ALARM_LOW_BATTERY;
- case 2:
- return Position.ALARM_SOS;
- case 3:
- return Position.ALARM_POWER_OFF;
- case 4:
- return Position.ALARM_REMOVING;
- default:
- return null;
- }
+ return switch (value) {
+ case 1 -> Position.ALARM_LOW_BATTERY;
+ case 2 -> Position.ALARM_SOS;
+ case 3 -> Position.ALARM_POWER_OFF;
+ case 4 -> Position.ALARM_REMOVING;
+ default -> null;
+ };
}
private Integer decodeBattery(int value) {
- switch (value) {
- case 0:
- return 10;
- case 1:
- return 30;
- case 2:
- return 60;
- case 3:
- return 80;
- case 4:
- return 100;
- default:
- return null;
- }
+ return switch (value) {
+ case 0 -> 10;
+ case 1 -> 30;
+ case 2 -> 60;
+ case 3 -> 80;
+ case 4 -> 100;
+ default -> null;
+ };
}
@Override