Class EmailAddressCollection
- java.lang.Object
-
- microsoft.exchange.webservices.data.property.complex.ComplexProperty
-
- microsoft.exchange.webservices.data.property.complex.ComplexPropertyCollection<EmailAddress>
-
- microsoft.exchange.webservices.data.property.complex.EmailAddressCollection
-
- All Implemented Interfaces:
Iterable<EmailAddress>,ICustomXmlUpdateSerializer,ISelfValidate,ComplexFunctionDelegate<EwsServiceXmlReader>,IComplexPropertyChangedDelegate<EmailAddress>
public final class EmailAddressCollection extends ComplexPropertyCollection<EmailAddress>
Represents a collection of e-mail addresses.
-
-
Constructor Summary
Constructors Modifier Constructor Description EmailAddressCollection()Initializes a new instance.protectedEmailAddressCollection(String collectionItemXmlElementName)Initializes a new instance of the EmailAddressCollection class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EmailAddressadd(String smtpAddress)Adds an e-mail address to the collection.EmailAddressadd(String name, String smtpAddress)Adds an e-mail address to the collection.voidadd(EmailAddress emailAddress)Adds an e-mail address to the collection.voidaddEmailRange(Iterator<EmailAddress> emailAddresses)Adds multiple e-mail addresses to the collection.voidaddSmtpAddressRange(Iterator<String> smtpAddresses)Adds multiple e-mail addresses to the collection.voidclear()Clears the collection.protected EmailAddresscreateComplexProperty(String xmlElementName)Creates an EmailAddress object from an XML element name.protected StringgetCollectionItemXmlElementName(EmailAddress complexProperty)Retrieves the XML element name corresponding to the provided EmailAddress object.booleanremove(EmailAddress emailAddress)Removes an e-mail address from the collection.voidremoveAt(int index)Removes an e-mail address from the collection.booleanshouldWriteToXml()Determine whether we should write collection to XML or not.-
Methods inherited from class microsoft.exchange.webservices.data.property.complex.ComplexPropertyCollection
clearChangeLog, complexPropertyChanged, contains, getAddedItems, getCount, getItems, getModifiedItems, getPropertyAtIndex, getRemovedItems, indexOf, internalAdd, internalClear, internalRemove, internalRemoveAt, itemChanged, iterator, loadFromXml, loadFromXml, removeFromChangeLog, updateFromXml, writeDeleteUpdateToXml, writeElementsToXml, writeSetUpdateToXml, writeToXml
-
Methods inherited from class microsoft.exchange.webservices.data.property.complex.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, func, getNamespace, internalValidate, readAttributesFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXml, tryReadElementFromXmlToPatch, updateFromXml, validate, writeAttributesToXml, writeToXml
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
EmailAddressCollection
public EmailAddressCollection()
Initializes a new instance.
-
EmailAddressCollection
protected EmailAddressCollection(String collectionItemXmlElementName)
Initializes a new instance of the EmailAddressCollection class.- Parameters:
collectionItemXmlElementName- Name of the collection item XML element.
-
-
Method Detail
-
add
public void add(EmailAddress emailAddress)
Adds an e-mail address to the collection.- Parameters:
emailAddress- The e-mail address to add.
-
addEmailRange
public void addEmailRange(Iterator<EmailAddress> emailAddresses)
Adds multiple e-mail addresses to the collection.- Parameters:
emailAddresses- The e-mail addresses to add.
-
add
public EmailAddress add(String smtpAddress)
Adds an e-mail address to the collection.- Parameters:
smtpAddress- The SMTP address used to initialize the e-mail address.- Returns:
- An EmailAddress object initialized with the provided SMTP address.
-
addSmtpAddressRange
public void addSmtpAddressRange(Iterator<String> smtpAddresses)
Adds multiple e-mail addresses to the collection.- Parameters:
smtpAddresses- The SMTP addresses used to initialize the e-mail addresses.
-
add
public EmailAddress add(String name, String smtpAddress)
Adds an e-mail address to the collection.- Parameters:
name- The name used to initialize the e-mail address.smtpAddress- The SMTP address used to initialize the e-mail address.- Returns:
- An EmailAddress object initialized with the provided SMTP address.
-
clear
public void clear()
Clears the collection.
-
removeAt
public void removeAt(int index)
Removes an e-mail address from the collection.- Parameters:
index- The index of the e-mail address to remove.
-
remove
public boolean remove(EmailAddress emailAddress) throws Exception
Removes an e-mail address from the collection.- Parameters:
emailAddress- The e-mail address to remove.- Returns:
- True if the email address was successfully removed from the collection, false otherwise.
- Throws:
Exception- the exception
-
createComplexProperty
protected EmailAddress createComplexProperty(String xmlElementName)
Creates an EmailAddress object from an XML element name.- Specified by:
createComplexPropertyin classComplexPropertyCollection<EmailAddress>- Parameters:
xmlElementName- The XML element name from which to create the e-mail address.- Returns:
- An EmailAddress object.
-
getCollectionItemXmlElementName
protected String getCollectionItemXmlElementName(EmailAddress complexProperty)
Retrieves the XML element name corresponding to the provided EmailAddress object.- Specified by:
getCollectionItemXmlElementNamein classComplexPropertyCollection<EmailAddress>- Parameters:
complexProperty- The EmailAddress object from which to determine the XML element name.- Returns:
- The XML element name corresponding to the provided EmailAddress object.
-
shouldWriteToXml
public boolean shouldWriteToXml()
Determine whether we should write collection to XML or not.- Overrides:
shouldWriteToXmlin classComplexPropertyCollection<EmailAddress>- Returns:
- Always true, even if the collection is empty.
-
-