public class UserUtils extends Object
| Constructor and Description |
|---|
UserUtils() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static boolean isValidEmail(String email)
email - potential email address.public static User populateNames(User user)
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.
user - potentially partially populated user. The username
of the user cannot be blank.getDisplayName(String, String, String, String),
getFirstName(String, String),
getLastName(String, String)Copyright © 2019 Atlassian. All rights reserved.