Package com.atlassian.jira.rest.v2.issue
Class UserBeanBuilder
java.lang.Object
com.atlassian.jira.rest.v2.issue.UserBeanBuilder
Builder for UserBean instances.
- Since:
- v4.2
-
Constructor Summary
ConstructorsConstructorDescriptionUserBeanBuilder
(JiraBaseUrls jiraBaseUrls) Creates new instance of UserBeanBuilder. -
Method Summary
Modifier and TypeMethodDescriptionapplicationRoles
(Set<ApplicationRole> applicationRoles) Sets the ApplicationRole for given useravatarService
(AvatarService avatarService) Sets the AvatarService to use for constructing the avatar URL.buildFull
(ApplicationRoleBeanConverter applicationRoleBeanConverter) Returns a new UserBean with all properties set.buildMid()
Returns a new UserBean with all properties set.Returns a new UserBean with the name, self, and author properties set.protected URI
createSelfLink
(boolean userDeleted) emailFormatter
(EmailFormatter emailFormatter) Sets the EmailFormatter to use for users' email addresses.static UserBeanBuilder
fullBuilder
(JiraBaseUrls jiraBaseUrls, EmailFormatter emailFormatter, AvatarService avatarService, I18nHelper.BeanFactory beanFactory, UserManager userManager, ApplicationUser loggedInUser) Builder with all dependencies for invokingbuildFull(ApplicationRoleBeanConverter)
Sets the groups that this user belongs to.i18nBeanFactory
(I18nHelper.BeanFactory beanFactory) lastLoginTime
(String lastLoginTime) loggedInUser
(ApplicationUser loggedInUser) Sets the currently logged in user.static UserBeanBuilder
midBuilder
(JiraBaseUrls jiraBaseUrls, EmailFormatter emailFormatter, I18nHelper.BeanFactory beanFactory, UserManager userManager, ApplicationUser loggedInUser) Builder with all dependencies for invokingbuildMid()
Sets the self URI.static UserBeanBuilder
shortBuilder
(JiraBaseUrls jiraBaseUrls) Builder with all dependencies for invokingbuildShort()
user
(ApplicationUser user) Sets the User.user
(String username, UserManager userManager) Sets the user using a username and UserManager.userManager
(UserManager userManager) Sets the UserManager to use for obtaining information about deleted user.
-
Constructor Details
-
UserBeanBuilder
Creates new instance of UserBeanBuilder. Requires JiraBaseUrls to build values of self parameter.- Parameters:
jiraBaseUrls
- An instance of JiraBaseUrls
-
-
Method Details
-
fullBuilder
public static UserBeanBuilder fullBuilder(@Nonnull JiraBaseUrls jiraBaseUrls, @Nonnull EmailFormatter emailFormatter, @Nonnull AvatarService avatarService, @Nonnull I18nHelper.BeanFactory beanFactory, @Nonnull UserManager userManager, @Nullable ApplicationUser loggedInUser) Builder with all dependencies for invokingbuildFull(ApplicationRoleBeanConverter)
- Returns:
- UserBeanBuilder
-
midBuilder
public static UserBeanBuilder midBuilder(@Nonnull JiraBaseUrls jiraBaseUrls, @Nonnull EmailFormatter emailFormatter, @Nonnull I18nHelper.BeanFactory beanFactory, @Nonnull UserManager userManager, @Nullable ApplicationUser loggedInUser) Builder with all dependencies for invokingbuildMid()
- Returns:
- UserBeanBuilder
-
shortBuilder
Builder with all dependencies for invokingbuildShort()
- Returns:
- UserBeanBuilder
-
user
Sets the User.- Parameters:
user
- a User- Returns:
- this
-
user
Sets the user using a username and UserManager. If the given User no longer exists, we still create a UserBean with the given username- Parameters:
username
- The usernameuserManager
- The UserManager- Returns:
- this Builder
-
groups
Sets the groups that this user belongs to.- Parameters:
groups
- the groups that this user belongs to.- Returns:
- this
-
self
Sets the self URI.- Parameters:
self
- self URI.- Returns:
- this
-
loggedInUser
Sets the currently logged in user.- Parameters:
loggedInUser
- a User- Returns:
- this
-
timeZone
-
i18nBeanFactory
-
emailFormatter
Sets the EmailFormatter to use for users' email addresses.- Parameters:
emailFormatter
- an EmailFormatter- Returns:
- this
-
avatarService
Sets the AvatarService to use for constructing the avatar URL.- Parameters:
avatarService
- an AvatarService- Returns:
- this
-
userManager
Sets the UserManager to use for obtaining information about deleted user.- Parameters:
userManager
- an UserManager- Returns:
- this
-
applicationRoles
Sets the ApplicationRole for given user- Parameters:
applicationRoles
-- Returns:
-
lastLoginTime
-
buildShort
Returns a new UserBean with the name, self, and author properties set. Note that some of user information will be missing: - deleted user flag - email address - groups - application roles - timezone - locale- Returns:
- a new UserBean
-
buildFull
Returns a new UserBean with all properties set.- Returns:
- a new UserBean
-
buildMid
Returns a new UserBean with all properties set.- Returns:
- a new UserBean
-
createSelfLink
-