Package com.atlassian.crowd.util
Class UserUtils
java.lang.Object
com.atlassian.crowd.util.UserUtils
General utility class for email related methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isValidEmail
(String email) Deprecated.static User
populateNames
(User user) Ensures that the first name, last name and displayName of the user object is fully populated.
-
Constructor Details
-
UserUtils
public UserUtils()
-
-
Method Details
-
isValidEmail
Deprecated.useEmailAddressValidator
. Since 4.4.0.Returns true if an email address is valid.- Parameters:
email
- potential email address.- Returns:
- true if an email address is valid.
-
populateNames
Ensures that the first name, last name and displayName of the user object is fully populated.Examples: Original data Populated 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)
-
EmailAddressValidator
.