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 MailAddress
eMail(String email)
Gets a new instance ofMailAddress
.boolean
equals(Object o)
javax.mail.internet.InternetAddress
getAuthorizedInternetAddress()
Gets from this defined mail address the corresponding authorizedInternetAddress
according to the ruled defined byMailUtil.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.
-
-
-
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.AddressException
Gets from this defined mail address the corresponding authorizedInternetAddress
according 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
-
-