Package ch.astorm.jotlmsg
Class OutlookMessageRecipient
- java.lang.Object
-
- ch.astorm.jotlmsg.OutlookMessageRecipient
-
public class OutlookMessageRecipient extends Object
Represents a recipient.- Author:
- Cedric Tabin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOutlookMessageRecipient.TypeRepresents the type of recipient.
-
Constructor Summary
Constructors Constructor Description OutlookMessageRecipient(OutlookMessageRecipient.Type type, String email)Creates a newOutlookMessageRecipientwith the giventypeandemailand a null name.OutlookMessageRecipient(OutlookMessageRecipient.Type type, String email, String name)Creates a newOutlookMessageRecipientwith the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.mail.AddressgetAddress()Returns a newAddressfrom the email of this recipient.StringgetEmail()Defines the email of the recipient.StringgetName()Defines the name of the recipient.OutlookMessageRecipient.TypegetType()Returns the type of recipient.voidsetEmail(String email)voidsetName(String name)
-
-
-
Constructor Detail
-
OutlookMessageRecipient
public OutlookMessageRecipient(OutlookMessageRecipient.Type type, String email)
Creates a newOutlookMessageRecipientwith the giventypeandemailand a null name.- Parameters:
type- The type.email- The email or null.
-
OutlookMessageRecipient
public OutlookMessageRecipient(OutlookMessageRecipient.Type type, String email, String name)
Creates a newOutlookMessageRecipientwith the specified parameters.- Parameters:
type- The type.email- The email or null.name- The name or null.
-
-
Method Detail
-
getType
public final OutlookMessageRecipient.Type getType()
Returns the type of recipient.- Returns:
- The type of recipient.
-
getName
public String getName()
Defines the name of the recipient. This value may be null.
-
setName
public void setName(String name)
-
getEmail
public String getEmail()
Defines the email of the recipient. This value may be null.
-
setEmail
public void setEmail(String email)
-
getAddress
public javax.mail.Address getAddress() throws javax.mail.internet.AddressExceptionReturns a newAddressfrom the email of this recipient. If the email is not defined, this method returns null.- Returns:
- A new
InternetAddress. - Throws:
javax.mail.internet.AddressException- If the email is not valid.
-
-