Package org.silverpeas.core.mail
Class MailAddress
- java.lang.Object
-
- org.silverpeas.core.mail.MailAddress
-
public class MailAddress extends Object
Specifies an email address.- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MailAddresseMail(String email)Gets a new instance ofMailAddress.booleanequals(Object o)javax.mail.internet.InternetAddressgetAuthorizedInternetAddress()Gets from this defined mail address the corresponding authorizedInternetAddressaccording to the ruled defined byMailUtil.getAuthorizedEmailAddress(String, String).StringgetEmail()Gets the email.StringgetName()Gets the name.inthashCode()MailAddresswithName(String name)Permits to specify the name of the person or organization linked to the email.
-
-
-
Method Detail
-
eMail
public static MailAddress eMail(String email)
Gets a new instance ofMailAddress.- 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:
- the functional name.
-
getAuthorizedInternetAddress
public javax.mail.internet.InternetAddress getAuthorizedInternetAddress() throws UnsupportedEncodingException, javax.mail.internet.AddressExceptionGets from this defined mail address the corresponding authorizedInternetAddressaccording to the ruled defined byMailUtil.getAuthorizedEmailAddress(String, String).- Returns:
- the authorized
MailUtil.getAuthorizedEmailAddress(String, String). - Throws:
UnsupportedEncodingException- if the text encoding is not supportedjavax.mail.internet.AddressException- if the address isn't well formatted
-
-