Package com.atlassian.crowd.validator
Interface EmailAddressValidator
- All Known Implementing Classes:
CloudCompatibleEmailValidator
public interface EmailAddressValidator
Validates email address(es).
- Since:
- 4.4.0
-
Method Summary
Modifier and TypeMethodDescriptionlong
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
Validates whether email address has valid syntax.- Parameters:
emailAddress
- email address to validate- Returns:
- true if email address has valid syntax, false otherwise
-
validateSyntax
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
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
-