microsoft.exchange.webservices.data
Class Mailbox

java.lang.Object
  extended by microsoft.exchange.webservices.data.ComplexProperty
      extended by microsoft.exchange.webservices.data.Mailbox
All Implemented Interfaces:
ISearchStringProvider

public class Mailbox
extends ComplexProperty
implements ISearchStringProvider

Represents a mailbox reference.


Constructor Summary
Mailbox()
          Initializes a new instance of the Mailbox class.
Mailbox(java.lang.String smtpAddress)
          * Initializes a new instance of the Mailbox class.
Mailbox(java.lang.String address, java.lang.String routingType)
          * Initializes a new instance of the Mailbox class.
 
Method Summary
 boolean equals(java.lang.Object obj)
          * Determines whether the specified Object is equal to the current Object.
 java.lang.String getAddress()
          Gets the address.
static Mailbox getMailboxFromString(java.lang.String smtpAddress)
          * Defines an implicit conversion between a string representing an SMTP address and Mailbox.
 java.lang.String getRoutingType()
          Gets the routing type of the address used to refer to the user mailbox.
 java.lang.String getSearchString()
          Get a string representation for using this instance in a search filter.
 int hashCode()
          Serves as a hash function for a particular type.
protected  void internalValidate()
          Validates this instance.
 boolean isValid()
          True if this instance is valid, false otherthise.
 void setAddress(java.lang.String address)
          Sets the address.
 void setRoutingType(java.lang.String routingType)
          Sets the routing type.
 java.lang.String toString()
          Returns a String that represents the current Object.
protected  boolean tryReadElementFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
          * Tries to 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, loadFromXml, loadFromXml, readAttributesFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXmlToPatch, updateFromXml, updateFromXml, validate, writeAttributesToXml, writeToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mailbox

public Mailbox()
Initializes a new instance of the Mailbox class.


Mailbox

public Mailbox(java.lang.String smtpAddress)
* Initializes a new instance of the Mailbox class.

Parameters:
smtpAddress - the smtp address

Mailbox

public Mailbox(java.lang.String address,
               java.lang.String routingType)
* Initializes a new instance of the Mailbox class.

Parameters:
address - the address
routingType - the routing type
Method Detail

getAddress

public java.lang.String getAddress()
Gets the address.

Returns:
the address

setAddress

public void setAddress(java.lang.String address)
Sets the address.

Parameters:
address - the new address

isValid

public boolean isValid()
True if this instance is valid, false otherthise.

Returns:
true if this instance is valid; otherwise false

getRoutingType

public java.lang.String getRoutingType()
Gets the routing type of the address used to refer to the user mailbox.

Returns:
the routing type

setRoutingType

public void setRoutingType(java.lang.String routingType)
Sets the routing type.

Parameters:
routingType - the new routing type

getMailboxFromString

public static Mailbox getMailboxFromString(java.lang.String smtpAddress)
* Defines an implicit conversion between a string representing an SMTP address and Mailbox.

Parameters:
smtpAddress - the smtp address
Returns:
A Mailbox initialized with the specified SMTP address.

tryReadElementFromXml

protected boolean tryReadElementFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
                                 throws java.lang.Exception
* Tries to read element from XML.

Overrides:
tryReadElementFromXml in class ComplexProperty
Parameters:
reader - the reader
Returns:
True if element was read.
Throws:
java.lang.Exception - the exception

writeElementsToXml

protected void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                           throws javax.xml.stream.XMLStreamException,
                                  ServiceXmlSerializationException
* Writes elements to XML.

Overrides:
writeElementsToXml in class ComplexProperty
Parameters:
writer - the writer
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception
ServiceXmlSerializationException - the service xml serialization 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.

internalValidate

protected void internalValidate()
                         throws ServiceValidationException,
                                java.lang.Exception
Validates this instance.

Overrides:
internalValidate in class ComplexProperty
Throws:
java.lang.Exception
ServiceValidationException

equals

public boolean equals(java.lang.Object obj)
* Determines whether the specified Object is equal to the current Object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the obj
Returns:
true if the specified Object is equal to the current Object otherwise, false.

hashCode

public int hashCode()
Serves as a hash function for a particular type.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code for the current object

toString

public java.lang.String toString()
Returns a String that represents the current Object.

Overrides:
toString in class java.lang.Object
Returns:
A String that represents the current Object.