Interface EmailAddressValidator

All Known Implementing Classes:
CloudCompatibleEmailValidator

public interface EmailAddressValidator
Validates email address(es).
Since:
4.4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    findDuplicates(List<String> emailAddresses)
    Finds duplicate in a given list of email addresses.
    boolean
    isValidSyntax(String emailAddress)
    Validates whether email address has valid syntax.
    long
    validateSyntax(List<String> emailAddresses)
    Validates syntax of provided email addresses.
  • Method Details

    • isValidSyntax

      boolean isValidSyntax(String emailAddress)
      Validates whether email address has valid syntax.
      Parameters:
      emailAddress - email address to validate
      Returns:
      true if email address has valid syntax, false otherwise
    • validateSyntax

      long validateSyntax(List<String> emailAddresses)
      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.

      Parameters:
      emailAddresses - list of email addresses
      Returns:
      number of invalid email addresses
    • findDuplicates

      long findDuplicates(List<String> emailAddresses)
      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.

      Parameters:
      emailAddresses - list of email addresses
      Returns:
      number of duplicated email addresses