private ImmutableMap<String, String> getDashboardItemProperties(final Long id)
{
List<String> propertyKeys = jsonEntityPropertyManager.findKeys(DASHBOARD_ITEM_PROPERTY.getDbEntityName(), id);
return ImmutableMaps.toMap(Iterables.collect(propertyKeys, new Function<String, Option<Map.Entry<String, String>>>()
{
@Override
public Option<Map.Entry<String, String>> apply(final String propertyKey)
{
return Option.option(jsonEntityPropertyManager.get(DASHBOARD_ITEM_PROPERTY.getDbEntityName(), id, propertyKey)).map(new Function<EntityProperty, Map.Entry<String, String>>()
{
@Override
public Map.Entry<String, String> apply(final EntityProperty entityProperty)
{
final String value = fromJsonString(entityProperty.getValue());
return Maps.immutableEntry(propertyKey, Strings.nullToEmpty(value));
}
});
}
}));
}