microsoft.exchange.webservices.data
Class EmailAddress

java.lang.Object
  extended by microsoft.exchange.webservices.data.ComplexProperty
      extended by microsoft.exchange.webservices.data.EmailAddress
All Implemented Interfaces:
ISearchStringProvider
Direct Known Subclasses:
Attendee

public class EmailAddress
extends ComplexProperty
implements ISearchStringProvider

Represents an e-mail address.


Field Summary
protected static java.lang.String SmtpRoutingType
          The Constant SmtpRoutingType.
 
Constructor Summary
  EmailAddress()
          * Initializes a new instance.
protected EmailAddress(EmailAddress mailbox)
          * Initializes a new instance from another EmailAddress instance.
  EmailAddress(java.lang.String smtpAddress)
          * Initializes a new instance.
  EmailAddress(java.lang.String name, java.lang.String smtpAddress)
          * Initializes a new instance.
  EmailAddress(java.lang.String name, java.lang.String address, java.lang.String routingType)
          * Initializes a new instance.
protected EmailAddress(java.lang.String name, java.lang.String address, java.lang.String routingType, MailboxType mailboxType)
          * Initializes a new instance.
protected EmailAddress(java.lang.String name, java.lang.String address, java.lang.String routingType, MailboxType mailboxType, ItemId id)
          * Initializes a new instance.
 
Method Summary
 java.lang.String getAddress()
          Gets the actual address associated with the e-mail address.
static EmailAddress getEmailAddressFromString(java.lang.String smtpAddress)
          Defines an implicit conversion between a string representing an SMTP address and EmailAddress.
 ItemId getId()
          * Gets the Id of the contact the e-mail address represents.
 MailboxType getMailboxType()
          Gets the type of the e-mail address.
 java.lang.String getName()
          * Gets the name associated with the e-mail address.
 java.lang.String getRoutingType()
          * Gets the routing type associated with the e-mail address.
 java.lang.String getSearchString()
          Get a string representation for using this instance in a search filter.
protected  java.lang.String getSmtpRoutingType()
          * Gets the routing type.
 void setAddress(java.lang.String address)
          Sets the actual address associated with the e-mail address.
 void setId(ItemId id)
          * Sets the Id of the contact the e-mail address represents.
 void setMailboxType(MailboxType mailboxType)
          * Sets the type of the e-mail address.
 void setName(java.lang.String name)
          * Sets the name associated with the e-mail address.
 void setRoutingType(java.lang.String routingType)
          Sets the routing type associated with the e-mail address.
 java.lang.String toString()
          Returns string that represents the current instance.
protected  boolean tryReadElementFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
          Try read element from xml.
protected  void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          * Writes elements to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, clearChangeLog, func, getNamespace, internalValidate, loadFromXml, loadFromXml, readAttributesFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXmlToPatch, updateFromXml, updateFromXml, validate, writeAttributesToXml, writeToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SmtpRoutingType

protected static final java.lang.String SmtpRoutingType
The Constant SmtpRoutingType.

See Also:
Constant Field Values
Constructor Detail

EmailAddress

public EmailAddress()
* Initializes a new instance.


EmailAddress

public EmailAddress(java.lang.String smtpAddress)
* Initializes a new instance.

Parameters:
smtpAddress - The SMTP address used to initialize the EmailAddress.

EmailAddress

public EmailAddress(java.lang.String name,
                    java.lang.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(java.lang.String name,
                    java.lang.String address,
                    java.lang.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(java.lang.String name,
                       java.lang.String address,
                       java.lang.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(java.lang.String name,
                       java.lang.String address,
                       java.lang.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 java.lang.Exception
* Initializes a new instance from another EmailAddress instance.

Parameters:
mailbox - EMailAddress instance to copy.
Throws:
java.lang.Exception - the exception
Method Detail

getName

public java.lang.String getName()
* Gets the name associated with the e-mail address.

Returns:
the name

setName

public void setName(java.lang.String name)
* Sets the name associated with the e-mail address.

Parameters:
name - the new name

getAddress

public java.lang.String getAddress()
Gets the actual address associated with the e-mail address.

Returns:
address associated with the e-mail address.

setAddress

public void setAddress(java.lang.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 java.lang.String getRoutingType()
* Gets the routing type associated with the e-mail address.

Returns:
the routing type

setRoutingType

public void setRoutingType(java.lang.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(java.lang.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

protected boolean tryReadElementFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
                                 throws java.lang.Exception
Try read element from xml.

Overrides:
tryReadElementFromXml in class ComplexProperty
Parameters:
reader - accepts EwsServiceXmlReader
Returns:
true
Throws:
java.lang.Exception - throws Exception

writeElementsToXml

protected void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                           throws java.lang.Exception
* Writes elements to XML.

Overrides:
writeElementsToXml in class ComplexProperty
Parameters:
writer - The writer.
Throws:
java.lang.Exception - the exception

getSearchString

public java.lang.String getSearchString()
Get a string representation for using this instance in a search filter.

Specified by:
getSearchString in interface ISearchStringProvider
Returns:
String representation of instance.

toString

public java.lang.String toString()
Returns string that represents the current instance.

Overrides:
toString in class java.lang.Object
Returns:
String representation of instance.

getSmtpRoutingType

protected java.lang.String getSmtpRoutingType()
* Gets the routing type.

Returns:
SMTP Routing type