Class UserUtils

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

public class UserUtils extends Object
General utility class for email related methods.
  • Constructor Details

    • UserUtils

      public UserUtils()
  • Method Details

    • isValidEmail

      @Deprecated public static boolean isValidEmail(String email)
      Deprecated.
      use EmailAddressValidator. 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

      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)