Class CanonicalFormConverter

java.lang.Object
edu.ucsb.cs156.frontiers.utilities.CanonicalFormConverter

public class CanonicalFormConverter extends Object
  • Constructor Details

    • CanonicalFormConverter

      public CanonicalFormConverter()
  • Method Details

    • convertToValidEmail

      public static String convertToValidEmail(String email)
      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

      public static boolean areEquivalentEmails(String email1, String email2)
      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