Class EmailAddress
- java.lang.Object
-
- microsoft.exchange.webservices.data.property.complex.ComplexProperty
-
- microsoft.exchange.webservices.data.property.complex.EmailAddress
-
- All Implemented Interfaces:
ISelfValidate,ComplexFunctionDelegate<EwsServiceXmlReader>,ISearchStringProvider
- Direct Known Subclasses:
Attendee
public class EmailAddress extends ComplexProperty implements ISearchStringProvider
Represents an e-mail address.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringSmtpRoutingTypeThe Constant SmtpRoutingType.
-
Constructor Summary
Constructors Modifier Constructor Description EmailAddress()Initializes a new instance.EmailAddress(String smtpAddress)Initializes a new instance.EmailAddress(String name, String smtpAddress)Initializes a new instance.EmailAddress(String name, String address, String routingType)Initializes a new instance.protectedEmailAddress(String name, String address, String routingType, MailboxType mailboxType)Initializes a new instance.protectedEmailAddress(String name, String address, String routingType, MailboxType mailboxType, ItemId id)Initializes a new instance.protectedEmailAddress(EmailAddress mailbox)Initializes a new instance from another EmailAddress instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAddress()Gets the actual address associated with the e-mail address.static EmailAddressgetEmailAddressFromString(String smtpAddress)Defines an implicit conversion between a string representing an SMTP address and EmailAddress.ItemIdgetId()Gets the Id of the contact the e-mail address represents.MailboxTypegetMailboxType()Gets the type of the e-mail address.StringgetName()Gets the name associated with the e-mail address.StringgetRoutingType()Gets the routing type associated with the e-mail address.StringgetSearchString()Get a string representation for using this instance in a search filter.protected StringgetSmtpRoutingType()Gets the routing type.voidsetAddress(String address)Sets the actual address associated with the e-mail address.voidsetId(ItemId id)Sets the Id of the contact the e-mail address represents.voidsetMailboxType(MailboxType mailboxType)Sets the type of the e-mail address.voidsetName(String name)Sets the name associated with the e-mail address.voidsetRoutingType(String routingType)Sets the routing type associated with the e-mail address.StringtoString()Returns string that represents the current instance.booleantryReadElementFromXml(EwsServiceXmlReader reader)Try read element from xml.voidwriteElementsToXml(EwsServiceXmlWriter writer)Writes elements to XML.-
Methods inherited from class microsoft.exchange.webservices.data.property.complex.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, clearChangeLog, func, getNamespace, internalValidate, loadFromXml, loadFromXml, readAttributesFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXmlToPatch, updateFromXml, updateFromXml, validate, writeAttributesToXml, writeToXml, writeToXml
-
-
-
-
Field Detail
-
SmtpRoutingType
protected static final String SmtpRoutingType
The Constant SmtpRoutingType.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EmailAddress
public EmailAddress()
Initializes a new instance.
-
EmailAddress
public EmailAddress(String smtpAddress)
Initializes a new instance.- Parameters:
smtpAddress- The SMTP address used to initialize the EmailAddress.
-
EmailAddress
public EmailAddress(String name, String smtpAddress)
Initializes a new instance.- Parameters:
name- The name used to initialize the EmailAddress.smtpAddress- The SMTP address used to initialize the EmailAddress.
-
EmailAddress
public EmailAddress(String name, String address, String routingType)
Initializes a new instance.- Parameters:
name- The name used to initialize the EmailAddress.address- The address used to initialize the EmailAddress.routingType- The routing type used to initialize the EmailAddress.
-
EmailAddress
protected EmailAddress(String name, String address, String routingType, MailboxType mailboxType)
Initializes a new instance.- Parameters:
name- The name used to initialize the EmailAddress.address- The address used to initialize the EmailAddress.routingType- The routing type used to initialize the EmailAddress.mailboxType- Mailbox type of the participant.
-
EmailAddress
protected EmailAddress(String name, String address, String routingType, MailboxType mailboxType, ItemId id)
Initializes a new instance.- Parameters:
name- The name used to initialize the EmailAddress.address- The address used to initialize the EmailAddress.routingType- The routing type used to initialize the EmailAddress.mailboxType- Mailbox type of the participant.id- ItemId of a Contact or PDL.
-
EmailAddress
protected EmailAddress(EmailAddress mailbox) throws Exception
Initializes a new instance from another EmailAddress instance.- Parameters:
mailbox- EMailAddress instance to copy.- Throws:
Exception- the exception
-
-
Method Detail
-
setName
public void setName(String name)
Sets the name associated with the e-mail address.- Parameters:
name- the new name
-
getAddress
public String getAddress()
Gets the actual address associated with the e-mail address.- Returns:
- address associated with the e-mail address.
-
setAddress
public void setAddress(String address)
Sets the actual address associated with the e-mail address. The type of the Address property must match the specified routing type. If RoutingType is not set, Address is assumed to be an SMTP address.- Parameters:
address- address associated with the e-mail address.
-
getRoutingType
public String getRoutingType()
Gets the routing type associated with the e-mail address.- Returns:
- the routing type
-
setRoutingType
public void setRoutingType(String routingType)
Sets the routing type associated with the e-mail address. If RoutingType is not set, Address is assumed to be an SMTP address.- Parameters:
routingType- routing type associated with the e-mail address.
-
getMailboxType
public MailboxType getMailboxType()
Gets the type of the e-mail address.- Returns:
- type of the e-mail address.
-
setMailboxType
public void setMailboxType(MailboxType mailboxType)
Sets the type of the e-mail address.- Parameters:
mailboxType- the new mailbox type
-
getId
public ItemId getId()
Gets the Id of the contact the e-mail address represents.- Returns:
- the id
-
setId
public void setId(ItemId id)
Sets the Id of the contact the e-mail address represents. When Id is specified, Address should be set to null.- Parameters:
id- the new id
-
getEmailAddressFromString
public static EmailAddress getEmailAddressFromString(String smtpAddress)
Defines an implicit conversion between a string representing an SMTP address and EmailAddress.- Parameters:
smtpAddress- The SMTP address to convert to EmailAddress.- Returns:
- An EmailAddress initialized with the specified SMTP address.
-
tryReadElementFromXml
public boolean tryReadElementFromXml(EwsServiceXmlReader reader) throws Exception
Try read element from xml.- Overrides:
tryReadElementFromXmlin classComplexProperty- Parameters:
reader- accepts EwsServiceXmlReader- Returns:
- true
- Throws:
Exception- throws Exception
-
writeElementsToXml
public void writeElementsToXml(EwsServiceXmlWriter writer) throws Exception
Writes elements to XML.- Overrides:
writeElementsToXmlin classComplexProperty- Parameters:
writer- The writer.- Throws:
Exception- the exception
-
getSearchString
public String getSearchString()
Get a string representation for using this instance in a search filter.- Specified by:
getSearchStringin interfaceISearchStringProvider- Returns:
- String representation of instance.
-
getSmtpRoutingType
protected String getSmtpRoutingType()
Gets the routing type.- Returns:
- SMTP Routing type
-
-