diff options
Diffstat (limited to 'src/org/traccar/notification/PropertiesProvider.java')
-rw-r--r-- | src/org/traccar/notification/PropertiesProvider.java | 17 |
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; + } + } + } + } |