From d0536ccbc1b7234784c5e48288bbac00a60ef821 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 7 Jul 2024 07:33:16 -0700 Subject: Update switch statements --- src/main/java/org/traccar/protocol/JidoProtocolDecoder.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/main/java/org/traccar/protocol/JidoProtocolDecoder.java') diff --git a/src/main/java/org/traccar/protocol/JidoProtocolDecoder.java b/src/main/java/org/traccar/protocol/JidoProtocolDecoder.java index 98fb36e11..d843ba675 100644 --- a/src/main/java/org/traccar/protocol/JidoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/JidoProtocolDecoder.java @@ -66,14 +66,11 @@ public class JidoProtocolDecoder extends BaseProtocolDecoder { .compile(); private String decodeAlarm(int type) { - switch (type) { - case 3: - return Position.ALARM_LOW_BATTERY; - case 4: - return Position.ALARM_TAMPERING; - default: - return null; - } + return switch (type) { + case 3 -> Position.ALARM_LOW_BATTERY; + case 4 -> Position.ALARM_TAMPERING; + default -> null; + }; } @Override -- cgit v1.2.3