diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/GalileoProtocolEncoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/GalileoProtocolEncoder.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/org/traccar/protocol/GalileoProtocolEncoder.java b/src/main/java/org/traccar/protocol/GalileoProtocolEncoder.java index cd068b251..b0033a2ba 100644 --- a/src/main/java/org/traccar/protocol/GalileoProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/GalileoProtocolEncoder.java @@ -58,15 +58,13 @@ public class GalileoProtocolEncoder extends BaseProtocolEncoder { @Override protected Object encodeCommand(Command command) { - switch (command.getType()) { - case Command.TYPE_CUSTOM: - return encodeText(getUniqueId(command.getDeviceId()), command.getString(Command.KEY_DATA)); - case Command.TYPE_OUTPUT_CONTROL: - return encodeText(getUniqueId(command.getDeviceId()), - "Out " + command.getInteger(Command.KEY_INDEX) + "," + command.getString(Command.KEY_DATA)); - default: - return null; - } + return switch (command.getType()) { + case Command.TYPE_CUSTOM -> encodeText(getUniqueId(command.getDeviceId()), + command.getString(Command.KEY_DATA)); + case Command.TYPE_OUTPUT_CONTROL -> encodeText(getUniqueId(command.getDeviceId()), + "Out " + command.getInteger(Command.KEY_INDEX) + "," + command.getString(Command.KEY_DATA)); + default -> null; + }; } } |