Package com.atlassian.crowd.validator
Class CloudCompatibleEmailValidator
java.lang.Object
com.atlassian.crowd.validator.CloudCompatibleEmailValidator
- All Implemented Interfaces:
EmailAddressValidator
Email address validator compatible with Atlassian Cloud.
-
Constructor Summary
-
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.
-
Constructor Details
-
CloudCompatibleEmailValidator
public CloudCompatibleEmailValidator()
-
-
Method Details
-
isValidSyntax
Description copied from interface:EmailAddressValidator
Validates whether email address has valid syntax.- Specified by:
isValidSyntax
in interfaceEmailAddressValidator
- Parameters:
emailAddress
- email address to validate- Returns:
- true if email address has valid syntax, false otherwise
-
validateSyntax
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 interfaceEmailAddressValidator
- Parameters:
emailAddresses
- list of email addresses- Returns:
- number of invalid email addresses
-
findDuplicates
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 interfaceEmailAddressValidator
- Parameters:
emailAddresses
- list of email addresses- Returns:
- number of duplicated email addresses
-