public class EmailAddress
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable
EmailMessage
Constructor and Description |
---|
EmailAddress(EmailAddress emailAddress)
Constructs a new copy of an existing EmailMessage object.
|
EmailAddress(java.lang.String address)
Constructs a new EmailMessage object from an email address
string.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clone this object.
|
int |
compareTo(java.lang.Object obj)
Compare two email addresses.
|
boolean |
equals(java.lang.Object obj)
Determine whether this email address is equivalent to another email
address, by comparing the normalized address strings.
|
java.lang.String |
getAddress()
Get the RFC822-compliant email address string associated with this
EmailAddress object.
|
java.lang.String |
getPersonalName()
Get the user friend personal name associated with this
EmailAddress object.
|
int |
hashCode()
Get the hash code for this object.
|
static int |
parse(java.lang.String s,
java.util.Collection<EmailAddress> collection)
Parse a sequence of comma-separated email addresses into individual
EmailAddress objects, enforcing strict Internet RFC822
email address syntax requirements.
|
java.lang.String |
toString()
Convert this object into an RFC822-compliant email address.
|
public EmailAddress(java.lang.String address) throws EmailException
The @domain portion must be present.renoir@example.com Pierre Auguste Renoir <renoir@example.com> "Pierre Auguste Renoir" <renoir@example.com> renoir@example.com (Pierre Auguste Renoir)
address
- the addressEmailException
- bad email addresspublic EmailAddress(EmailAddress emailAddress) throws EmailException
emailAddress
- The EmailMessage object to copyEmailException
- bad email addresspublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other email address. Must be an EmailAddress
object.public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
obj
- the other email address. Must be an EmailAddress
object.public java.lang.String getAddress()
getPersonalName()
public java.lang.String getPersonalName()
getAddress()
public static int parse(java.lang.String s, java.util.Collection<EmailAddress> collection) throws EmailException
s
- comma-separated address stringscollection
- where to stored the parsed EmailAddress
objectsEmailException
- if a bad address is encounteredpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException