Class CloudCompatibleEmailValidator

java.lang.Object
com.atlassian.crowd.validator.CloudCompatibleEmailValidator
All Implemented Interfaces:
EmailAddressValidator

public class CloudCompatibleEmailValidator extends Object implements EmailAddressValidator
Email address validator compatible with Atlassian Cloud.
  • Constructor Details

    • CloudCompatibleEmailValidator

      public CloudCompatibleEmailValidator()
  • Method Details

    • isValidSyntax

      public boolean isValidSyntax(String emailAddress)
      Description copied from interface: EmailAddressValidator
      Validates whether email address has valid syntax.
      Specified by:
      isValidSyntax in interface EmailAddressValidator
      Parameters:
      emailAddress - email address to validate
      Returns:
      true if email address has valid syntax, false otherwise
    • validateSyntax

      public long validateSyntax(List<String> emailAddresses)
      Description copied from interface: EmailAddressValidator
      Validates syntax of provided email addresses.

      Note about duplicates: if provided email addresses contain duplicates which have invalid syntax, they are counted as separate email addresses.

      For example, for given list of email addresses: - validemail@validemail.com - invalidDuplicatedEmail@ - invalidEmail - invalidDuplicatedEmail@ the method will return 3.

      Specified by:
      validateSyntax in interface EmailAddressValidator
      Parameters:
      emailAddresses - list of email addresses
      Returns:
      number of invalid email addresses
    • findDuplicates

      public long findDuplicates(List<String> emailAddresses)
      Description copied from interface: EmailAddressValidator
      Finds duplicate in a given list of email addresses.

      For example, for given list of email addresses: - validemail@validemail.com - validduplicatedemail@validduplicatedemail - validduplicatedemail@validduplicatedemail - invalid - invalidduplicated@ - invalidduplicated@ the method will return 4.

      Specified by:
      findDuplicates in interface EmailAddressValidator
      Parameters:
      emailAddresses - list of email addresses
      Returns:
      number of duplicated email addresses