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/NdtpV6ProtocolEncoder.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/main/java/org/traccar/protocol/NdtpV6ProtocolEncoder.java') diff --git a/src/main/java/org/traccar/protocol/NdtpV6ProtocolEncoder.java b/src/main/java/org/traccar/protocol/NdtpV6ProtocolEncoder.java index 7aac8658a..eac6de133 100644 --- a/src/main/java/org/traccar/protocol/NdtpV6ProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/NdtpV6ProtocolEncoder.java @@ -27,16 +27,12 @@ public class NdtpV6ProtocolEncoder extends BaseProtocolEncoder { @Override protected Object encodeCommand(Command command) { - switch (command.getType()) { - case Command.TYPE_IDENTIFICATION: - return "BB+IDNT"; - case Command.TYPE_REBOOT_DEVICE: - return "BB+RESET"; - case Command.TYPE_POSITION_SINGLE: - return "BB+RRCD"; - default: - return null; - } + return switch (command.getType()) { + case Command.TYPE_IDENTIFICATION -> "BB+IDNT"; + case Command.TYPE_REBOOT_DEVICE -> "BB+RESET"; + case Command.TYPE_POSITION_SINGLE -> "BB+RRCD"; + default -> null; + }; } } -- cgit v1.2.3