From 2005fd55347816cf4a86b66ae97bc245f53f0bcd Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 6 Jul 2024 19:47:06 -0700 Subject: Update switch statements --- .../java/org/traccar/protocol/CarcellProtocolEncoder.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java') diff --git a/src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java b/src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java index 78dbe7e91..7a460b7c4 100644 --- a/src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java @@ -28,14 +28,11 @@ public class CarcellProtocolEncoder extends StringProtocolEncoder { @Override protected Object encodeCommand(Command command) { - switch (command.getType()) { - case Command.TYPE_ENGINE_STOP: - return formatCommand(command, "$SRVCMD,%s,BA#\r\n", Command.KEY_UNIQUE_ID); - case Command.TYPE_ENGINE_RESUME: - return formatCommand(command, "$SRVCMD,%s,BD#\r\n", Command.KEY_UNIQUE_ID); - default: - return null; - } + return switch (command.getType()) { + case Command.TYPE_ENGINE_STOP -> formatCommand(command, "$SRVCMD,%s,BA#\r\n", Command.KEY_UNIQUE_ID); + case Command.TYPE_ENGINE_RESUME -> formatCommand(command, "$SRVCMD,%s,BD#\r\n", Command.KEY_UNIQUE_ID); + default -> null; + }; } } -- cgit v1.2.3