Package com.atlassian.bamboo.avatar
Interface HigherOrderAvatarProvider
- All Known Implementing Classes:
HigherOrderAvatarProviderImpl
public interface HigherOrderAvatarProvider
Bamboo comes with different ways of providing avatars for users including gravatar and custom avatars saved directly on Bamboo Server.
This api encapsulates it and works as a source of truth for the avatar of a user.
The priority of the avatar is as follows:
1. Custom avatar saved on Bamboo Server
2. Gravatar linked to the email address of the user
3. Default avatar
Be aware that gravatar also provides default, because of that, when the gravatar functionality is used,
the default avatar will come from it.
- Since:
- 9.5
-
Method Summary
Modifier and TypeMethodDescription@NotNull io.atlassian.fugue.Either<String,
CacheableAvatarSupplier> getForAnonymousUser
(int size) Returns either the avatar supplier or the gravatar url for an anonymous user.@NotNull io.atlassian.fugue.Either<String,
CacheableAvatarSupplier> getForUser
(@NotNull com.atlassian.user.User user, int size) Returns either the avatar supplier or the gravatar url for the given user.
-
Method Details
-
getForUser
@NotNull @NotNull io.atlassian.fugue.Either<String,CacheableAvatarSupplier> getForUser(@NotNull @NotNull com.atlassian.user.User user, int size) Returns either the avatar supplier or the gravatar url for the given user. All UI related use cases.- Parameters:
user
- the user to get the avatar forsize
- the size to retrieve the avatar in- Returns:
- either the avatar supplier for the given user or gravatar url
-
getForAnonymousUser
@NotNull @NotNull io.atlassian.fugue.Either<String,CacheableAvatarSupplier> getForAnonymousUser(int size) Returns either the avatar supplier or the gravatar url for an anonymous user. All UI related use cases.- Parameters:
size
- the size to retrieve the avatar in- Returns:
- either the avatar supplier or gravatar url
-