diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java | 41 |
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 |