Class CanonicalFormConverter
java.lang.Object
edu.ucsb.cs156.frontiers.utilities.CanonicalFormConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
areEquivalentEmails
(String email1, String email2) Check whether two emails are equivalent in their canonical formstatic String
convertToValidEmail
(String email) Converts an email address to a valid canonical form.
-
Constructor Details
-
CanonicalFormConverter
public CanonicalFormConverter()
-
-
Method Details
-
convertToValidEmail
Converts an email address to a valid canonical form.Some universities may have email systems where there are multiple valid representations of the same email address.
This method ensures that the email is in a consistent canonical form. This is the place to isolate these conversions, so that if the rules change, we only have to change them in one place.
- Parameters:
email
-- Returns:
- email in canonical form
-
areEquivalentEmails
Check whether two emails are equivalent in their canonical form- Parameters:
email1
-email2
-- Returns:
- true if the canonical forms of the two emails are equal, false otherwise
-