diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-11-24 16:49:54 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-24 16:49:54 +1300 |
commit | ebe64e810bd8e57a805a571cfd6110fbc3cd57c1 (patch) | |
tree | 90d8bb347c6081116df225d5c1e08f9469458675 /src/org/traccar/database/DeviceManager.java | |
parent | 04f33e6ba29b3a73a65b081d2a8b6ac3e0e0ebee (diff) | |
parent | 03fb12d4a9453d6845198a167a70e720726df2e2 (diff) | |
download | trackermap-server-ebe64e810bd8e57a805a571cfd6110fbc3cd57c1.tar.gz trackermap-server-ebe64e810bd8e57a805a571cfd6110fbc3cd57c1.tar.bz2 trackermap-server-ebe64e810bd8e57a805a571cfd6110fbc3cd57c1.zip |
Merge pull request #2593 from Abyss777/attributes_helpers
Attributes helpers
Diffstat (limited to 'src/org/traccar/database/DeviceManager.java')
-rw-r--r-- | src/org/traccar/database/DeviceManager.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index 5681602fe..600669579 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -401,14 +401,12 @@ public class DeviceManager implements IdentityManager { String result = null; Device device = getDeviceById(deviceId); if (device != null) { - if (device.getAttributes().containsKey(attributeName)) { - result = (String) device.getAttributes().get(attributeName); - } + result = device.getString(attributeName); if (result == null && lookupGroupsAttribute) { long groupId = device.getGroupId(); while (groupId != 0) { if (getGroupById(groupId) != null) { - result = (String) getGroupById(groupId).getAttributes().get(attributeName); + result = getGroupById(groupId).getString(attributeName); if (result != null) { break; } @@ -421,7 +419,7 @@ public class DeviceManager implements IdentityManager { if (result == null) { if (lookupServer) { Server server = Context.getPermissionsManager().getServer(); - result = (String) server.getAttributes().get(attributeName); + result = server.getString(attributeName); } else { result = Context.getConfig().getString(attributeName); } |