aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notification/PropertiesProvider.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-12-15 12:28:29 +0500
committerAbyss777 <abyss@fox5.ru>2017-12-15 14:03:15 +0500
commit5debe74dd68df32e86478a2e54e6f5efdddbf236 (patch)
tree4f3ded0595af97dcf4dae7a2a92e2fcf74b1792a /src/org/traccar/notification/PropertiesProvider.java
parent0c8bf8867456c55231f2aabf36970504d4e8cab7 (diff)
downloadtrackermap-server-5debe74dd68df32e86478a2e54e6f5efdddbf236.tar.gz
trackermap-server-5debe74dd68df32e86478a2e54e6f5efdddbf236.tar.bz2
trackermap-server-5debe74dd68df32e86478a2e54e6f5efdddbf236.zip
Handle boolean parameters in mail related attributes
Diffstat (limited to 'src/org/traccar/notification/PropertiesProvider.java')
-rw-r--r--src/org/traccar/notification/PropertiesProvider.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/org/traccar/notification/PropertiesProvider.java b/src/org/traccar/notification/PropertiesProvider.java
index c5ba688e8..8f5965a82 100644
--- a/src/org/traccar/notification/PropertiesProvider.java
+++ b/src/org/traccar/notification/PropertiesProvider.java
@@ -61,4 +61,21 @@ public class PropertiesProvider {
}
}
+ public Boolean getBoolean(String key) {
+ if (config != null) {
+ if (config.hasKey(key)) {
+ return config.getBoolean(key);
+ } else {
+ return null;
+ }
+ } else {
+ Object result = extendedModel.getAttributes().get(key);
+ if (result != null) {
+ return result instanceof String ? Boolean.valueOf((String) result) : (Boolean) result;
+ } else {
+ return null;
+ }
+ }
+ }
+
}