org.silverpeas.mail
Class MailAddress

java.lang.Object
  extended by org.silverpeas.mail.MailAddress

public class MailAddress
extends Object

Specifies an email address.

Author:
Yohann Chastagnier

Method Summary
static MailAddress eMail(String email)
          Gets a new instance of MailAddress.
 boolean equals(Object o)
           
 javax.mail.internet.InternetAddress getAuthorizedInternetAddress()
          Gets from this defined mail address the corresponding authorized InternetAddress according to the ruled defined by MailUtil.getAuthorizedEmailAddress(String, String).
 String getEmail()
          Gets the email.
 String getName()
          Gets the name.
 int hashCode()
           
 MailAddress withName(String name)
          Permits to specify the name of the person or organization linked to the email.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

eMail

public static MailAddress eMail(String email)
Gets a new instance of MailAddress.

Parameters:
email - the email.
Returns:
a new instance of MailAddress.

withName

public MailAddress withName(String name)
Permits to specify the name of the person or organization linked to the email.

Parameters:
name - the functional name associated to the email. If the name is not defined, then an empty string is taken into account.
Returns:
the completed instance.

getEmail

public String getEmail()
Gets the email.

Returns:
the email.

getName

public String getName()
Gets the name.

Returns:

getAuthorizedInternetAddress

public javax.mail.internet.InternetAddress getAuthorizedInternetAddress()
                                                                 throws UnsupportedEncodingException,
                                                                        javax.mail.internet.AddressException
Gets from this defined mail address the corresponding authorized InternetAddress according to the ruled defined by MailUtil.getAuthorizedEmailAddress(String, String).

Returns:
the authorized MailUtil.getAuthorizedEmailAddress(String, String).
Throws:
UnsupportedEncodingException
javax.mail.internet.AddressException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2016 Silverpeas. All Rights Reserved.