Class Email

java.lang.Object
io.jenetics.jpx.Email
All Implemented Interfaces:
Serializable, Comparable<Email>

public final class Email extends Object implements Comparable<Email>, Serializable
An email address. Broken into two parts (id and domain) to help prevent email harvesting.
Since:
1.0
Version:
1.2
See Also:
  • Method Details

    • getID

      public String getID()
      Return the id half of the email address.
      Returns:
      the id half of the email address
    • getDomain

      public String getDomain()
      Return the domain half of the email address.
      Returns:
      the domain half of the email address
    • getAddress

      public String getAddress()
      Return the full EMail address: id + "@" + domain.
      Returns:
      the full EMail address: id + "@" + domain
    • compareTo

      public int compareTo(Email other)
      Specified by:
      compareTo in interface Comparable<Email>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • of

      public static Email of(String id, String domain)
      Create a new Email object with the given id and domain.
      Parameters:
      id - id half of email address (billgates2004)
      domain - domain half of email address (hotmail.com)
      Returns:
      a new Email object with the given values
      Throws:
      NullPointerException - if one of the argument is null
    • of

      public static Email of(String address)
      Create a new Email from the given address string.
      Parameters:
      address - the email address string
      Returns:
      a new Email object with address
      Throws:
      NullPointerException - if one of the argument is null
      IllegalArgumentException - if the given address is invalid