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/AdmProtocolEncoder.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/main/java/org/traccar/protocol/AdmProtocolEncoder.java') diff --git a/src/main/java/org/traccar/protocol/AdmProtocolEncoder.java b/src/main/java/org/traccar/protocol/AdmProtocolEncoder.java index c02fa4112..9bd0e7909 100644 --- a/src/main/java/org/traccar/protocol/AdmProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/AdmProtocolEncoder.java @@ -29,16 +29,11 @@ public class AdmProtocolEncoder extends StringProtocolEncoder { @Override protected Object encodeCommand(Command command) { - switch (command.getType()) { - case Command.TYPE_GET_DEVICE_STATUS: - return formatCommand(command, "STATUS\r\n"); - - case Command.TYPE_CUSTOM: - return formatCommand(command, "%s\r\n", Command.KEY_DATA); - - default: - return null; - } + return switch (command.getType()) { + case Command.TYPE_GET_DEVICE_STATUS -> formatCommand(command, "STATUS\r\n"); + case Command.TYPE_CUSTOM -> formatCommand(command, "%s\r\n", Command.KEY_DATA); + default -> null; + }; } } -- cgit v1.2.3