Class CachingUserFormat
java.lang.Object
com.atlassian.jira.plugin.userformat.CachingUserFormat
- All Implemented Interfaces:
UserFormat
Wrapping implementation of UserFormat that caches the results in RequestCache.
Note: results of both format methods are cached in the same cache. But for example format("1", "2") and format("1", "2", null) are still considered as different invocations because there is no guarantee they will return the same results.
- Since:
- v6.4
-
Field Summary
Fields inherited from interface com.atlassian.jira.plugin.profile.UserFormat
VIEW_TEMPLATE -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CachingUserFormat
-
-
Method Details
-
format
Description copied from interface:UserFormatRenders the formatted user for a given section on the screen. Please note that the username may be null (eg for empty fields, anonymous user's, etc) or the user may not exist. Implementations should handle these cases.Extra context can be passed to the renderer via the id attribute. Ideally an implementation might include this id in the rendered output such that it can be used for test assertions.
The result should always be ready to display in an HTML response i.e. it should be HTML encoded if necessary.
- Specified by:
formatin interfaceUserFormat- Parameters:
userkey- the user's userkey to format.id- A value providing extra context to the rendering process.- Returns:
- the formatted user
-
format
Description copied from interface:UserFormatRenders the formatted user for a given section on the screen. Please note that the username may be null (eg for empty fields, anonymous user's, etc) or the user may not exist. Implementations should handle these cases.Extra context can be passed to the renderer via the params attribute.
The result should always be ready to display in an HTML response i.e. it should be HTML encoded if necessary.
- Specified by:
formatin interfaceUserFormat- Parameters:
userkey- the user's userkey to format.id- A value providing extra context to the rendering process.params- Additional context to pass to the renderer- Returns:
- the formatted user
-