8702a88523
This new map inside of both IdentifiedUser and AccountState allows plugins to store their own information within a single user instance, or the cached AccountState. A property cache is primarily useful for an expensive AvatarProvider that may need to lookup data based on AccountExternalIds on the AccountState or the IdentifiedUser and reuse this for multiple getUrl() invocations of varying image sizes. Plugins can use it like this: private static final CurrentUser.PropertyKey<String> imageUrl = CurrentUser.PropertyKey.create(); public String getUrl(IdentifiedUser user, int size) { String url = user.get(imageUrl); if (url == null) { url = "http://image.host/" + userId + "?size="; user.set(imageUrl, url); } return url + size; } Begin using this for the notification filters, which are only used inside of IsWatchedByPredicate, a non-common predicate. This gets the database code out of IdentifiedUser and isolates it down to the sole user in the query system. Change-Id: Ica7409411eaf60af8d554c33b873c930b9abea6f |
||
---|---|---|
.. | ||
commit-message-length-validator@8d295ed48e | ||
cookbook-plugin@3e801bd7d4 | ||
download-commands@fb05fb988e | ||
replication@945c842f9c | ||
reviewnotes@c167df08a8 | ||
singleusergroup@141898f9e1 | ||
BUCK |