aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/config/Config.java
diff options
context:
space:
mode:
authorAnton Tananaev <atananaev@lyft.com>2020-12-28 17:02:23 -0800
committerAnton Tananaev <atananaev@lyft.com>2020-12-28 17:02:23 -0800
commit51704590a835057bf4850a5eaf8c5037d20f648a (patch)
treec38acebce6cfec36ead21918d6272a99452b9ac5 /src/main/java/org/traccar/config/Config.java
parent551298664bbac541450d83a021a2f8d77e65b216 (diff)
downloadtrackermap-server-51704590a835057bf4850a5eaf8c5037d20f648a.tar.gz
trackermap-server-51704590a835057bf4850a5eaf8c5037d20f648a.tar.bz2
trackermap-server-51704590a835057bf4850a5eaf8c5037d20f648a.zip
Migrate long config keys
Diffstat (limited to 'src/main/java/org/traccar/config/Config.java')
-rw-r--r--src/main/java/org/traccar/config/Config.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/org/traccar/config/Config.java b/src/main/java/org/traccar/config/Config.java
index 6cc21cbeb..713f5c607 100644
--- a/src/main/java/org/traccar/config/Config.java
+++ b/src/main/java/org/traccar/config/Config.java
@@ -117,17 +117,17 @@ public class Config {
}
public long getLong(ConfigKey<Long> key) {
- return getLong(key.getKey());
- }
-
- @Deprecated
- public long getLong(String key) {
- return getLong(key, 0);
- }
-
- @Deprecated
- public long getLong(String key, long defaultValue) {
- return hasKey(key) ? Long.parseLong(getString(key)) : defaultValue;
+ String value = getString(key.getKey());
+ if (value != null) {
+ return Long.parseLong(value);
+ } else {
+ Long defaultValue = key.getDefaultValue();
+ if (defaultValue != null) {
+ return defaultValue;
+ } else {
+ return 0;
+ }
+ }
}
public double getDouble(ConfigKey<Double> key) {