com.atlassian.jira.rest.v2.issue
Class UserBeanBuilder

java.lang.Object
  extended by com.atlassian.jira.rest.v2.issue.UserBeanBuilder

public class UserBeanBuilder
extends Object

Builder for UserBean instances.

Since:
v4.2

Constructor Summary
UserBeanBuilder(JiraBaseUrls jiraBaseUrls)
          Creates new instance of UserBeanBuilder.
 
Method Summary
 UserBeanBuilder avatarService(AvatarService avatarService)
          Sets the AvatarService to use for constructing the avatar URL.
 UserBean buildFull()
          Returns a new UserBean with all properties set.
 UserBean buildMid()
          Returns a new UserBean with all properties set.
 UserBean buildShort()
          Returns a new UserBean with the name, self, and author properties set.
protected  URI createSelfLink()
           
 UserBeanBuilder emailFormatter(EmailFormatter emailFormatter)
          Sets the EmailFormatter to use for users' email addresses.
 UserBeanBuilder groups(List<String> groups)
          Sets the groups that this user belongs to.
 UserBeanBuilder loggedInUser(ApplicationUser loggedInUser)
          Sets the currently logged in user.
 UserBeanBuilder loggedInUser(com.atlassian.crowd.embedded.api.User loggedInUser)
          Sets the currently logged in user.
 UserBeanBuilder self(URI self)
          Sets the self URI.
 UserBeanBuilder timeZone(TimeZone timeZone)
           
 UserBeanBuilder user(ApplicationUser user)
          Sets the User.
 UserBeanBuilder user(String username, UserManager userManager)
          Sets the user using a username and UserManager.
 UserBeanBuilder user(com.atlassian.crowd.embedded.api.User user)
          Sets the User.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserBeanBuilder

public UserBeanBuilder(JiraBaseUrls jiraBaseUrls)
Creates new instance of UserBeanBuilder. Requires JiraBaseUrls to build values of self parameter.

Parameters:
jiraBaseUrls - An instance of JiraBaseUrls
Method Detail

user

public UserBeanBuilder user(com.atlassian.crowd.embedded.api.User user)
Sets the User.

Parameters:
user - a User
Returns:
this

user

public UserBeanBuilder user(ApplicationUser user)
Sets the User.

Parameters:
user - a User
Returns:
this

user

public UserBeanBuilder user(String username,
                            UserManager userManager)
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 username
userManager - The UserManager
Returns:
this Builder

groups

public UserBeanBuilder groups(List<String> groups)
Sets the groups that this user belongs to.

Parameters:
groups - the groups that this user belongs to.
Returns:
this

self

public UserBeanBuilder self(URI self)
Sets the self URI.

Parameters:
self - self URI.
Returns:
this

loggedInUser

public UserBeanBuilder loggedInUser(com.atlassian.crowd.embedded.api.User loggedInUser)
Sets the currently logged in user.

Parameters:
loggedInUser - a User
Returns:
this

loggedInUser

public UserBeanBuilder loggedInUser(ApplicationUser loggedInUser)
Sets the currently logged in user.

Parameters:
loggedInUser - a User
Returns:
this

timeZone

public UserBeanBuilder timeZone(TimeZone timeZone)

emailFormatter

public UserBeanBuilder emailFormatter(EmailFormatter emailFormatter)
Sets the EmailFormatter to use for users' email addresses.

Parameters:
emailFormatter - an EmailFormatter
Returns:
this

avatarService

public UserBeanBuilder avatarService(AvatarService avatarService)
Sets the AvatarService to use for constructing the avatar URL.

Parameters:
avatarService - an AvatarService
Returns:
this

buildShort

public UserBean buildShort()
Returns a new UserBean with the name, self, and author properties set.

Returns:
a new UserBean

buildFull

public UserBean buildFull()
Returns a new UserBean with all properties set.

Returns:
a new UserBean

buildMid

public UserBean buildMid()
Returns a new UserBean with all properties set.

Returns:
a new UserBean

createSelfLink

protected URI createSelfLink()


Copyright © 2002-2014 Atlassian. All Rights Reserved.