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 --- .../java/org/traccar/protocol/UlbotechProtocolEncoder.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/main/java/org/traccar/protocol/UlbotechProtocolEncoder.java') diff --git a/src/main/java/org/traccar/protocol/UlbotechProtocolEncoder.java b/src/main/java/org/traccar/protocol/UlbotechProtocolEncoder.java index 5528c7242..10f408821 100644 --- a/src/main/java/org/traccar/protocol/UlbotechProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/UlbotechProtocolEncoder.java @@ -30,13 +30,11 @@ public class UlbotechProtocolEncoder extends BaseProtocolEncoder { @Override protected Object encodeCommand(Command command) { - switch (command.getType()) { - case Command.TYPE_CUSTOM: - return Unpooled.copiedBuffer( - "*TS01," + command.getString(Command.KEY_DATA) + "#", StandardCharsets.US_ASCII); - default: - return null; - } + return switch (command.getType()) { + case Command.TYPE_CUSTOM -> Unpooled.copiedBuffer( + "*TS01," + command.getString(Command.KEY_DATA) + "#", StandardCharsets.US_ASCII); + default -> null; + }; } } -- cgit v1.2.3