aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/PretraceProtocolEncoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/PretraceProtocolEncoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/PretraceProtocolEncoder.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/org/traccar/protocol/PretraceProtocolEncoder.java b/src/main/java/org/traccar/protocol/PretraceProtocolEncoder.java
index a109e7a07..354fc5992 100644
--- a/src/main/java/org/traccar/protocol/PretraceProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/PretraceProtocolEncoder.java
@@ -36,15 +36,13 @@ public class PretraceProtocolEncoder extends BaseProtocolEncoder {
String uniqueId = getUniqueId(command.getDeviceId());
- switch (command.getType()) {
- case Command.TYPE_CUSTOM:
- return formatCommand(uniqueId, command.getString(Command.KEY_DATA));
- case Command.TYPE_POSITION_PERIODIC:
- return formatCommand(
- uniqueId, String.format("D221%1$d,%1$d,,", command.getInteger(Command.KEY_FREQUENCY)));
- default:
- return null;
- }
+ return switch (command.getType()) {
+ case Command.TYPE_CUSTOM -> formatCommand(
+ uniqueId, command.getString(Command.KEY_DATA));
+ case Command.TYPE_POSITION_PERIODIC -> formatCommand(
+ uniqueId, String.format("D221%1$d,%1$d,,", command.getInteger(Command.KEY_FREQUENCY)));
+ default -> null;
+ };
}
}