aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/PortmanProtocolEncoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/PortmanProtocolEncoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/PortmanProtocolEncoder.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/java/org/traccar/protocol/PortmanProtocolEncoder.java b/src/main/java/org/traccar/protocol/PortmanProtocolEncoder.java
index eb3115db8..22c4c3127 100644
--- a/src/main/java/org/traccar/protocol/PortmanProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/PortmanProtocolEncoder.java
@@ -28,14 +28,11 @@ public class PortmanProtocolEncoder extends StringProtocolEncoder {
@Override
protected Object encodeCommand(Command command) {
- switch (command.getType()) {
- case Command.TYPE_ENGINE_STOP:
- return formatCommand(command, "&&%s,XA5\r\n", Command.KEY_UNIQUE_ID);
- case Command.TYPE_ENGINE_RESUME:
- return formatCommand(command, "&&%s,XA6\r\n", Command.KEY_UNIQUE_ID);
- default:
- return null;
- }
+ return switch (command.getType()) {
+ case Command.TYPE_ENGINE_STOP -> formatCommand(command, "&&%s,XA5\r\n", Command.KEY_UNIQUE_ID);
+ case Command.TYPE_ENGINE_RESUME -> formatCommand(command, "&&%s,XA6\r\n", Command.KEY_UNIQUE_ID);
+ default -> null;
+ };
}
}