com.atlassian.jira.web.component.multiuserpicker
Class UserBean

java.lang.Object
  extended by com.atlassian.jira.web.component.multiuserpicker.UserBean

public class UserBean
extends Object

A bean for pickertable.vm that is used for displaying the user info.

Since:
v3.13

Field Summary
static Comparator COMPARATOR
          Compares to user beans by full name comparison first, then username.
 
Constructor Summary
UserBean(String username)
          Constructs a bean for a non-existing user
UserBean(String username, String fullName)
          Constructs a bean for an existing user
 
Method Summary
static List convertUsernamesToUserBeans(Collection usernames)
          Converst a collection of usernames to an ordered list of user beans
static List convertUsersToUserBeans(Collection users)
          Converts a collection of user objects to an oredered list of user beans.
 String getFullName()
          Returns user's full name if this bean represents an existing user, empty string otherwise
 String getName()
          Returns the username
 boolean isReal()
          Returns true if this bean represents an existing user, false otherwise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPARATOR

public static final Comparator COMPARATOR
Compares to user beans by full name comparison first, then username.

It sorts users alphabetically by full name, if the user does not exist, only usernames is known, then it makes sure that such user bean comes last.

Constructor Detail

UserBean

public UserBean(String username,
                String fullName)
Constructs a bean for an existing user

Parameters:
username - username
fullName - user's full name

UserBean

public UserBean(String username)
Constructs a bean for a non-existing user

Parameters:
username - username
Method Detail

convertUsernamesToUserBeans

public static List convertUsernamesToUserBeans(Collection usernames)
Converst a collection of usernames to an ordered list of user beans

Parameters:
usernames - a collection of usernames
Returns:
a list of user beans, never null

convertUsersToUserBeans

public static List convertUsersToUserBeans(Collection users)
Converts a collection of user objects to an oredered list of user beans.

Parameters:
users - collection of user objects
Returns:
list of user beans, never null

getName

public String getName()
Returns the username

Returns:
username

getFullName

public String getFullName()
Returns user's full name if this bean represents an existing user, empty string otherwise

Returns:
user's full name if this bean represents an existing user, empty string otherwise

isReal

public boolean isReal()
Returns true if this bean represents an existing user, false otherwise

Returns:
true if this bean represents an existing user, false otherwise


Copyright © 2002-2009 Atlassian. All Rights Reserved.