microsoft.exchange.webservices.data
Class FolderId

java.lang.Object
  extended by microsoft.exchange.webservices.data.ComplexProperty
      extended by microsoft.exchange.webservices.data.ServiceId
          extended by microsoft.exchange.webservices.data.FolderId

public final class FolderId
extends ServiceId

Represents the Id of a folder.


Constructor Summary
protected FolderId()
          Initializes a new instance.
  FolderId(java.lang.String uniqueId)
          Initializes a new instance.Use this constructor to link this FolderId to an existing folder that you have the unique Id of.
  FolderId(WellKnownFolderName folderName)
          Initializes a new instance.Use this constructor to link this FolderId to a well known folder (e.g.
  FolderId(WellKnownFolderName folderName, Mailbox mailbox)
          Initializes a new instance.Use this constructor to link this FolderId to a well known folder (e.g.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determines whether the specified is equal to the current.
static FolderId getFolderIdFromString(java.lang.String uniqueId)
          Defines an implicit conversion between string and FolderId.
static FolderId getFolderIdFromWellKnownFolderName(WellKnownFolderName folderName)
          Defines an implicit conversion between WellKnownFolderName and FolderId.
 WellKnownFolderName getFolderName()
          Gets the name of the folder associated with the folder Id.
protected  boolean getIsValid()
          True if this instance is valid, false otherwise.
 Mailbox getMailbox()
          Gets the mailbox of the folder.
protected  java.lang.String getXmlElementName()
          Gets the name of the XML element.
 int hashCode()
          Serves as a hash function for a particular type.
 java.lang.String toString()
          Returns a String that represents the current Object.
protected  void validate(ExchangeVersion version)
          Validates FolderId against a specified request version.
protected  void writeAttributesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          Writes attributes to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.ServiceId
assign, getChangeKey, getUniqueId, isValid, readAttributesFromXml, sameIdAndChangeKey, setChangeKey, setUniqueId, writeToXml
 
Methods inherited from class microsoft.exchange.webservices.data.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, clearChangeLog, func, getNamespace, internalValidate, loadFromXml, loadFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXml, tryReadElementFromXmlToPatch, updateFromXml, updateFromXml, validate, writeElementsToXml, writeToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FolderId

protected FolderId()
Initializes a new instance.


FolderId

public FolderId(java.lang.String uniqueId)
         throws java.lang.Exception
Initializes a new instance.Use this constructor to link this FolderId to an existing folder that you have the unique Id of.

Parameters:
uniqueId - the unique id
Throws:
java.lang.Exception - the exception

FolderId

public FolderId(WellKnownFolderName folderName)
Initializes a new instance.Use this constructor to link this FolderId to a well known folder (e.g. Inbox, Calendar or Contacts)

Parameters:
folderName - the folder name

FolderId

public FolderId(WellKnownFolderName folderName,
                Mailbox mailbox)
Initializes a new instance.Use this constructor to link this FolderId to a well known folder (e.g. Inbox, Calendar or Contacts) in a specific mailbox.

Parameters:
folderName - the folder name
mailbox - the mailbox
Method Detail

getXmlElementName

protected java.lang.String getXmlElementName()
Gets the name of the XML element.

Specified by:
getXmlElementName in class ServiceId
Returns:
XML element name

writeAttributesToXml

protected void writeAttributesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                             throws ServiceXmlSerializationException
Writes attributes to XML.

Overrides:
writeAttributesToXml in class ServiceId
Parameters:
writer - the writer
Throws:
ServiceXmlSerializationException - the service xml serialization exception

validate

protected void validate(ExchangeVersion version)
                 throws ServiceVersionException
Validates FolderId against a specified request version.

Parameters:
version - the version
Throws:
ServiceVersionException - the service version exception

getFolderName

public WellKnownFolderName getFolderName()
Gets the name of the folder associated with the folder Id. Name and Id are mutually exclusive; if one is set, the other is null.

Returns:
the folder name

getMailbox

public Mailbox getMailbox()
Gets the mailbox of the folder. Mailbox is only set when FolderName is set.

Returns:
the mailbox

getFolderIdFromString

public static FolderId getFolderIdFromString(java.lang.String uniqueId)
                                      throws java.lang.Exception
Defines an implicit conversion between string and FolderId.

Parameters:
uniqueId - the unique id
Returns:
A FolderId initialized with the specified unique Id
Throws:
java.lang.Exception - the exception

getFolderIdFromWellKnownFolderName

public static FolderId getFolderIdFromWellKnownFolderName(WellKnownFolderName folderName)
Defines an implicit conversion between WellKnownFolderName and FolderId.

Parameters:
folderName - the folder name
Returns:
A FolderId initialized with the specified folder name

getIsValid

protected boolean getIsValid()
True if this instance is valid, false otherwise.

Returns:
the checks if is valid

equals

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

Overrides:
equals in class ServiceId
Parameters:
obj - the obj
Returns:
true if the specified is equal to the current

hashCode

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

Overrides:
hashCode in class ServiceId
Returns:
A hash code for the current

toString

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

Overrides:
toString in class ServiceId
Returns:
the string