aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Config.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/Config.java')
-rw-r--r--src/org/traccar/Config.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/org/traccar/Config.java b/src/org/traccar/Config.java
index 49d6e4fde..7fd725734 100644
--- a/src/org/traccar/Config.java
+++ b/src/org/traccar/Config.java
@@ -74,4 +74,16 @@ public class Config {
}
}
+ public double getDouble(String key) {
+ return getDouble(key, 0.0);
+ }
+
+ public double getDouble(String key, double defaultValue) {
+ if (properties.containsKey(key)) {
+ return Double.parseDouble(properties.getProperty(key));
+ } else {
+ return defaultValue;
+ }
+ }
+
}