diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-25 20:31:32 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-26 08:41:45 +1300 |
commit | 346c6befe177c6cffe99e6ac9cc6083000a2981c (patch) | |
tree | 5763d82e52cf6c1a5b2c2d499245069bb5e431be /src/org/traccar/protocol/MiniFinderProtocolEncoder.java | |
parent | 0f87445428a831e0f0d3b69f6f07f2a60272f2fb (diff) | |
download | trackermap-server-346c6befe177c6cffe99e6ac9cc6083000a2981c.tar.gz trackermap-server-346c6befe177c6cffe99e6ac9cc6083000a2981c.tar.bz2 trackermap-server-346c6befe177c6cffe99e6ac9cc6083000a2981c.zip |
Some more code cleanup
Diffstat (limited to 'src/org/traccar/protocol/MiniFinderProtocolEncoder.java')
-rw-r--r-- | src/org/traccar/protocol/MiniFinderProtocolEncoder.java | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/org/traccar/protocol/MiniFinderProtocolEncoder.java b/src/org/traccar/protocol/MiniFinderProtocolEncoder.java index 486f406a5..d3f49b4e4 100644 --- a/src/org/traccar/protocol/MiniFinderProtocolEncoder.java +++ b/src/org/traccar/protocol/MiniFinderProtocolEncoder.java @@ -25,25 +25,25 @@ public class MiniFinderProtocolEncoder extends StringProtocolEncoder implements @Override public String formatValue(String key, Object value) { - - if (key.equals(Command.KEY_ENABLE)) { - return (Boolean) value ? "1" : "0"; - } else if (key.equals(Command.KEY_TIMEZONE)) { - return String.format("%+03d", TimeZone.getTimeZone((String) value).getRawOffset() / 3600000); - } else if (key.equals(Command.KEY_INDEX)) { - switch (((Number) value).intValue()) { - case 0: - return "A"; - case 1: - return "B"; - case 2: - return "C"; - default: - return null; - } + switch (key) { + case Command.KEY_ENABLE: + return (Boolean) value ? "1" : "0"; + case Command.KEY_TIMEZONE: + return String.format("%+03d", TimeZone.getTimeZone((String) value).getRawOffset() / 3600000); + case Command.KEY_INDEX: + switch (((Number) value).intValue()) { + case 0: + return "A"; + case 1: + return "B"; + case 2: + return "C"; + default: + return null; + } + default: + return null; } - - return null; } @Override |