Class SearchFilter.SearchFilterCollection
- java.lang.Object
-
- microsoft.exchange.webservices.data.property.complex.ComplexProperty
-
- microsoft.exchange.webservices.data.search.filter.SearchFilter
-
- microsoft.exchange.webservices.data.search.filter.SearchFilter.SearchFilterCollection
-
- All Implemented Interfaces:
Iterable<SearchFilter>,ISelfValidate,ComplexFunctionDelegate<EwsServiceXmlReader>,IComplexPropertyChangedDelegate
- Enclosing class:
- SearchFilter
public static class SearchFilter.SearchFilterCollection extends SearchFilter implements Iterable<SearchFilter>, IComplexPropertyChangedDelegate
Represents a collection of search filter linked by a logical operator. Applications can use SearchFilterCollection to define complex search filter such as "Condition1 AND Condition2".
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class microsoft.exchange.webservices.data.search.filter.SearchFilter
SearchFilter.ContainsSubstring, SearchFilter.ExcludesBitmask, SearchFilter.Exists, SearchFilter.IsEqualTo, SearchFilter.IsGreaterThan, SearchFilter.IsGreaterThanOrEqualTo, SearchFilter.IsLessThan, SearchFilter.IsLessThanOrEqualTo, SearchFilter.IsNotEqualTo, SearchFilter.Not, SearchFilter.PropertyBasedFilter, SearchFilter.RelationalFilter, SearchFilter.SearchFilterCollection
-
-
Constructor Summary
Constructors Constructor Description SearchFilterCollection()Initializes a new instance of the class.SearchFilterCollection(LogicalOperator logicalOperator)Initializes a new instance of the class.SearchFilterCollection(LogicalOperator logicalOperator, Iterable<SearchFilter> searchFilters)Initializes a new instance of the class.SearchFilterCollection(LogicalOperator logicalOperator, SearchFilter... searchFilters)Initializes a new instance of the class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(SearchFilter searchFilter)Adds a search filter of any type to the collection.voidaddRange(Iterable<SearchFilter> searchFilters)Adds multiple search filter to the collection.voidclear()Clears the collection.voidcomplexPropertyChanged(ComplexProperty complexProperty)Complex property changed.booleancontains(SearchFilter searchFilter)Determines whether a specific search filter is in the collection.intgetCount()Gets the total number of search filter in the collection.LogicalOperatorgetLogicalOperator()Gets the logical operator that links the serach filter in this collection.SearchFiltergetSearchFilter(int index)Gets the search filter at the specified index.protected StringgetXmlElementName()Gets the name of the XML element.protected voidinternalValidate()Validate instance.Iterator<SearchFilter>iterator()voidremove(SearchFilter searchFilter)Removes a search filter from the collection.voidremoveAt(int index)Removes the search filter at the specified index from the collection.voidsetLogicalOperator(LogicalOperator logicalOperator)Sets the logical operator that links the serach filter in this collection.voidsetSearchFilter(int index, SearchFilter searchFilter)Sets the search filter at the specified index.booleantryReadElementFromXml(EwsServiceXmlReader reader)Tries to read element from XML.voidwriteElementsToXml(EwsServiceXmlWriter writer)Writes the elements to XML.voidwriteToXml(EwsServiceXmlWriter writer)Writes to XML.-
Methods inherited from class microsoft.exchange.webservices.data.search.filter.SearchFilter
loadFromXml
-
Methods inherited from class microsoft.exchange.webservices.data.property.complex.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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
SearchFilterCollection
public SearchFilterCollection()
Initializes a new instance of the class.
-
SearchFilterCollection
public SearchFilterCollection(LogicalOperator logicalOperator)
Initializes a new instance of the class.- Parameters:
logicalOperator- The logical operator used to initialize the collection.
-
SearchFilterCollection
public SearchFilterCollection(LogicalOperator logicalOperator, SearchFilter... searchFilters)
Initializes a new instance of the class.- Parameters:
logicalOperator- The logical operator used to initialize the collection.searchFilters- The search filter to add to the collection.
-
SearchFilterCollection
public SearchFilterCollection(LogicalOperator logicalOperator, Iterable<SearchFilter> searchFilters)
Initializes a new instance of the class.- Parameters:
logicalOperator- The logical operator used to initialize the collection.searchFilters- The search filter to add to the collection.
-
-
Method Detail
-
internalValidate
protected void internalValidate() throws Exception
Validate instance.- Overrides:
internalValidatein classComplexProperty- Throws:
Exception
-
getXmlElementName
protected String getXmlElementName()
Gets the name of the XML element.- Specified by:
getXmlElementNamein classSearchFilter- Returns:
- xml element name
-
tryReadElementFromXml
public boolean tryReadElementFromXml(EwsServiceXmlReader reader) throws Exception
Tries to read element from XML.- Overrides:
tryReadElementFromXmlin classComplexProperty- Parameters:
reader- the reader- Returns:
- true, if successful
- Throws:
Exception- the exception
-
writeElementsToXml
public void writeElementsToXml(EwsServiceXmlWriter writer) throws Exception
Writes the elements to XML.- Overrides:
writeElementsToXmlin classComplexProperty- Parameters:
writer- the writer- Throws:
Exception- the exception
-
writeToXml
public void writeToXml(EwsServiceXmlWriter writer) throws Exception
Writes to XML.- Overrides:
writeToXmlin classSearchFilter- Parameters:
writer- the writer- Throws:
Exception- the exception
-
add
public void add(SearchFilter searchFilter)
Adds a search filter of any type to the collection.- Parameters:
searchFilter- The search filter to add. Available search filter classes includeSearchFilter.IsEqualTo,SearchFilter.ContainsSubstringandSearchFilter.SearchFilterCollection
-
addRange
public void addRange(Iterable<SearchFilter> searchFilters)
Adds multiple search filter to the collection.- Parameters:
searchFilters- The search filter to add. Available search filter classes includeSearchFilter.IsEqualTo,SearchFilter.ContainsSubstringandSearchFilter.SearchFilterCollection
-
clear
public void clear()
Clears the collection.
-
contains
public boolean contains(SearchFilter searchFilter)
Determines whether a specific search filter is in the collection.- Parameters:
searchFilter- The search filter to locate in the collection.- Returns:
- True is the search filter was found in the collection, false otherwise.
-
remove
public void remove(SearchFilter searchFilter)
Removes a search filter from the collection.- Parameters:
searchFilter- The search filter to remove
-
removeAt
public void removeAt(int index)
Removes the search filter at the specified index from the collection.- Parameters:
index- The zero-based index of the search filter to remove.
-
getCount
public int getCount()
Gets the total number of search filter in the collection.- Returns:
- the count
-
getSearchFilter
public SearchFilter getSearchFilter(int index)
Gets the search filter at the specified index.- Parameters:
index- the index- Returns:
- The search filter at the specified index.
-
setSearchFilter
public void setSearchFilter(int index, SearchFilter searchFilter)
Sets the search filter at the specified index.- Parameters:
index- the indexsearchFilter- the search filter
-
getLogicalOperator
public LogicalOperator getLogicalOperator()
Gets the logical operator that links the serach filter in this collection.- Returns:
- LogicalOperator
-
setLogicalOperator
public void setLogicalOperator(LogicalOperator logicalOperator)
Sets the logical operator that links the serach filter in this collection.- Parameters:
logicalOperator- the new logical operator
-
complexPropertyChanged
public void complexPropertyChanged(ComplexProperty complexProperty)
Description copied from interface:IComplexPropertyChangedDelegateComplex property changed.- Specified by:
complexPropertyChangedin interfaceIComplexPropertyChangedDelegate- Parameters:
complexProperty- the complex property
-
iterator
public Iterator<SearchFilter> iterator()
- Specified by:
iteratorin interfaceIterable<SearchFilter>
-
-