Class StringList
- java.lang.Object
-
- microsoft.exchange.webservices.data.property.complex.ComplexProperty
-
- microsoft.exchange.webservices.data.property.complex.StringList
-
- All Implemented Interfaces:
Iterable<String>,ISelfValidate,ComplexFunctionDelegate<EwsServiceXmlReader>
public class StringList extends ComplexProperty implements Iterable<String>
Represents a list of strings.
-
-
Constructor Summary
Constructors Constructor Description StringList()Initializes a new instance of theStringListclass.StringList(Iterable<String> strings)Initializes a new instance of theStringListclass.StringList(String itemXmlElementName)Initializes a new instance of the "StringList" class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String s)Adds a string to the list.voidaddRange(Iterable<String> strings)Adds multiple strings to the list.voidclearList()Clears the list.booleancontains(String s)Determines whether the list contains a specific string.booleanequals(Object obj)Indicates whether some other object is "equal to" this one.Iterator<String>getIterator()Gets an iterator that iterates through the elements of the collection.intgetSize()Gets the number of strings in the list.StringgetString(int index)Gets the string at the specified index.inthashCode()Serves as a hash function for a particular type.Iterator<String>iterator()Returns an iterator over a set of elements of type T.booleanremove(String s)Removes a string from the list.voidremoveAt(int index)Removes the string at the specified position from the list.voidsetString(int index, Object object)Sets the string at the specified index.StringtoString()Returns a string representation of the object.booleantryReadElementFromXml(EwsServiceXmlReader reader)Tries to read element from XML.voidwriteElementsToXml(EwsServiceXmlWriter writer)Writes elements to XML.-
Methods inherited from class microsoft.exchange.webservices.data.property.complex.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, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
StringList
public StringList()
Initializes a new instance of theStringListclass.
-
StringList
public StringList(Iterable<String> strings)
Initializes a new instance of theStringListclass.- Parameters:
strings- The strings.
-
StringList
public StringList(String itemXmlElementName)
Initializes a new instance of the "StringList" class.- Parameters:
itemXmlElementName- Name of the item XML element.
-
-
Method Detail
-
tryReadElementFromXml
public boolean tryReadElementFromXml(EwsServiceXmlReader reader) throws XMLStreamException, ServiceXmlDeserializationException
Tries to read element from XML.- Overrides:
tryReadElementFromXmlin classComplexProperty- Parameters:
reader- accepts EwsServiceXmlReader- Returns:
- True if element was read
- Throws:
XMLStreamException- the XML stream exceptionServiceXmlDeserializationException- the service xml deserialization exception
-
writeElementsToXml
public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException, XMLStreamException
Writes elements to XML.- Overrides:
writeElementsToXmlin classComplexProperty- Parameters:
writer- accepts EwsServiceXmlWriter- Throws:
ServiceXmlSerializationException- the service xml serialization exceptionXMLStreamException- the XML stream exception
-
addRange
public void addRange(Iterable<String> strings)
Adds multiple strings to the list.- Parameters:
strings- The strings to add.
-
contains
public boolean contains(String s)
Determines whether the list contains a specific string.- Parameters:
s- The string to check the presence of.- Returns:
- True if s is present in the list, false otherwise.
-
remove
public boolean remove(String s)
Removes a string from the list.- Parameters:
s- The string to remove.- Returns:
- True is s was removed, false otherwise.
-
removeAt
public void removeAt(int index)
Removes the string at the specified position from the list.- Parameters:
index- The index of the string to remove.
-
clearList
public void clearList()
Clears the list.
-
toString
public String toString()
Returns a string representation of the object. In general, thetoStringmethod returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. ThetoStringmethod for classObjectreturns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:getClass().getName() + '@' + Integer.toHexString(hashCode())
-
getSize
public int getSize()
Gets the number of strings in the list.- Returns:
- the size
-
getString
public String getString(int index)
Gets the string at the specified index.- Parameters:
index- The index of the string to get or set.- Returns:
- The string at the specified index.
-
setString
public void setString(int index, Object object)
Sets the string at the specified index.- Parameters:
index- The indexobject- The object.
-
getIterator
public Iterator<String> getIterator()
Gets an iterator that iterates through the elements of the collection.- Returns:
- An Iterator for the collection.
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one. Theequalsmethod implements an equivalence relation on non-null object references:- It is reflexive: for any non-null reference value
x,x.equals(x)should returntrue. - It is symmetric: for any non-null reference values
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified. - For any non-null reference value
x,x.equals(null)should returnfalse.
equalsmethod for classObjectimplements the most discriminating possible equivalence relation on objects; that is, for any non-null reference valuesxandy, this method returnstrueif and only ifxandyrefer to the same object (x == yhas the valuetrue). Note that it is generally necessary to override thehashCodemethod whenever this method is overridden, so as to maintain the general contract for thehashCodemethod, which states that equal objects must have equal hash codes.- Overrides:
equalsin classObject- Parameters:
obj- the reference object with which to compare.- Returns:
- if this object is the same as the obj argument; otherwise.
- See Also:
hashCode(),Hashtable
- It is reflexive: for any non-null reference value
-
hashCode
public int hashCode()
Serves as a hash function for a particular type.
-
-