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