diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-13 23:11:23 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-13 23:11:23 +1300 |
commit | 398b705820109c1103d915a2fec81fcf70b032cf (patch) | |
tree | 659a0483eda19f9c91855197b70fd2a0bfb82a60 /src/org/traccar/model/MiscFormatter.java | |
parent | 2da5669f8bd3f734fa37626c892aebdff7268613 (diff) | |
download | trackermap-server-398b705820109c1103d915a2fec81fcf70b032cf.tar.gz trackermap-server-398b705820109c1103d915a2fec81fcf70b032cf.tar.bz2 trackermap-server-398b705820109c1103d915a2fec81fcf70b032cf.zip |
Fix some check style issues
Diffstat (limited to 'src/org/traccar/model/MiscFormatter.java')
-rw-r--r-- | src/org/traccar/model/MiscFormatter.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/org/traccar/model/MiscFormatter.java b/src/org/traccar/model/MiscFormatter.java index 2bc6207fb..8f95f5c45 100644 --- a/src/org/traccar/model/MiscFormatter.java +++ b/src/org/traccar/model/MiscFormatter.java @@ -15,9 +15,6 @@ */ package org.traccar.model; -import org.traccar.helper.Log; -import org.traccar.web.JsonConverter; - import java.text.DecimalFormat; import java.util.LinkedHashMap; import java.util.Map; @@ -27,19 +24,21 @@ import javax.json.JsonObject; import javax.json.JsonObjectBuilder; import javax.json.JsonString; import javax.json.JsonValue; +import org.traccar.helper.Log; +import org.traccar.web.JsonConverter; /** * Format extended tracker status */ public class MiscFormatter { - private static final String xmlRootNode = "info"; + private static final String XML_ROOT_NODE = "info"; - private static final DecimalFormat decimalFormat = new DecimalFormat("#.##"); + private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#.##"); private static String format(Object value) { if (value instanceof Double || value instanceof Float) { - return decimalFormat.format(value); + return DECIMAL_FORMAT.format(value); } else { return value.toString(); } @@ -48,7 +47,7 @@ public class MiscFormatter { public static String toXmlString(Map<String, Object> attributes) { StringBuilder result = new StringBuilder(); - result.append("<").append(xmlRootNode).append(">"); + result.append("<").append(XML_ROOT_NODE).append(">"); for (Map.Entry<String, Object> entry : attributes.entrySet()) { @@ -57,7 +56,7 @@ public class MiscFormatter { result.append("</").append(entry.getKey()).append(">"); } - result.append("</").append(xmlRootNode).append(">"); + result.append("</").append(XML_ROOT_NODE).append(">"); return result.toString(); } |