microsoft.exchange.webservices.data.core.response
Class ServiceResponseCollection<TResponse extends ServiceResponse>

java.lang.Object
  extended by microsoft.exchange.webservices.data.core.response.ServiceResponseCollection<TResponse>
Type Parameters:
TResponse - The type of response stored in the list.
All Implemented Interfaces:
Iterable<TResponse>

public final class ServiceResponseCollection<TResponse extends ServiceResponse>
extends Object
implements Iterable<TResponse>

Represents a strongly typed list of service response.


Constructor Summary
ServiceResponseCollection()
          Initializes a new instance.
 
Method Summary
 void add(TResponse response)
          Adds specified response.
 int getCount()
          Gets the total number of response in the list.
 Enumeration<TResponse> getEnumerator()
          Gets the enumerator.
 ServiceResult getOverallResult()
          Gets a value indicating the overall result of the request that generated this response collection.
 TResponse getResponseAtIndex(int index)
          Gets the response at the specified index.
 Iterator<TResponse> iterator()
          Returns an iterator over a set of elements of type T.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceResponseCollection

public ServiceResponseCollection()
Initializes a new instance.

Method Detail

add

public void add(TResponse response)
Adds specified response.

Parameters:
response - The response.

getCount

public int getCount()
Gets the total number of response in the list.

Returns:
total number of response in the list.

getResponseAtIndex

public TResponse getResponseAtIndex(int index)
                                                     throws IndexOutOfBoundsException
Gets the response at the specified index.

Parameters:
index - The zero-based index of the response to get.
Returns:
The response at the specified index.
Throws:
IndexOutOfBoundsException - the index out of bounds exception

getOverallResult

public ServiceResult getOverallResult()
Gets a value indicating the overall result of the request that generated this response collection. If all of the response have their Result property set to Success, OverallResult returns Success. If at least one response has its Result property set to Warning and all other response have their Result property set to Success, OverallResult returns Warning. If at least one response has a its Result set to Error, OverallResult returns Error.

Returns:
the overall result

iterator

public Iterator<TResponse> iterator()
Returns an iterator over a set of elements of type T.

Specified by:
iterator in interface Iterable<TResponse extends ServiceResponse>
Returns:
an Iterator.

getEnumerator

public Enumeration<TResponse> getEnumerator()
Gets the enumerator.

Returns:
the enumerator


Copyright © 2012–2015 Microsoft. All rights reserved.