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/TopinProtocolEncoder.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/org/traccar/protocol/TopinProtocolEncoder.java') diff --git a/src/main/java/org/traccar/protocol/TopinProtocolEncoder.java b/src/main/java/org/traccar/protocol/TopinProtocolEncoder.java index 77f80b9d4..b3b6bc23f 100644 --- a/src/main/java/org/traccar/protocol/TopinProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/TopinProtocolEncoder.java @@ -54,13 +54,13 @@ public class TopinProtocolEncoder extends BaseProtocolEncoder { ByteBuf content = Unpooled.buffer(); - switch (command.getType()) { - case Command.TYPE_SOS_NUMBER: + return switch (command.getType()) { + case Command.TYPE_SOS_NUMBER -> { content.writeCharSequence(command.getString(Command.KEY_PHONE), StandardCharsets.US_ASCII); - return encodeContent(TopinProtocolDecoder.MSG_SOS_NUMBER, content); - default: - return null; - } + yield encodeContent(TopinProtocolDecoder.MSG_SOS_NUMBER, content); + } + default -> null; + }; } } -- cgit v1.2.3