diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/AdmProtocolEncoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/AdmProtocolEncoder.java | 15 |
1 files changed, 5 insertions, 10 deletions
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; + }; } } |