com.atlassian.crowd.util
Class UserUtils

java.lang.Object
  extended by com.atlassian.crowd.util.UserUtils

public class UserUtils
extends Object

General utility class for email related methods.


Constructor Summary
UserUtils()
           
 
Method Summary
static boolean isValidEmail(String email)
          Returns true if an email address is valid.
static User populateNames(User user)
          Ensures that the first name, last name and displayName of the user object is fully populated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserUtils

public UserUtils()
Method Detail

isValidEmail

public static boolean isValidEmail(String email)
Returns true if an email address is valid.

Parameters:
email - potential email address.
Returns:
true if an email address is valid.

populateNames

public static User populateNames(User user)
Ensures that the first name, last name and displayName of the user object is fully populated.

Examples:

Original dataPopulated data
("jsmith", "John", "Smith", "John Smith")("jsmith", "John", "Smith", "John Smith")
("jsmith", "", "", "John Smith")("jsmith", "John", "Smith", "John Smith")
("jsmith", "John", "Smith", "")("jsmith", "John", "Smith", "John Smith")
("jsmith", "", "", "")("jsmith", "", "jsmith", "jsmith")
("jsmith", null, null, null)("jsmith", "", "jsmith", "jsmith")

For more complicated cases, see the documentation for the other methods in this class.

Parameters:
user - potentially partially populated user. The username of the user cannot be blank.
Returns:
populated user with non-blank last name and displayName and non-null first name.
See Also:
getDisplayName(String, String, String, String), getFirstName(String, String), getLastName(String, String)


Copyright © 2014 Atlassian. All Rights Reserved.