com.unboundid.scim.sdk
Class Resources<R extends BaseResource>

java.lang.Object
  extended by com.unboundid.scim.sdk.Resources<R>
All Implemented Interfaces:
SCIMResponse, Iterable<R>

public class Resources<R extends BaseResource>
extends Object
implements Iterable<R>, SCIMResponse

Represents a list of SCIM resources returned by the service provider from a query/listing request.


Constructor Summary
Resources(List<R> resourceList)
          Create a new resources response from the provided list.
Resources(List<R> resourceList, int totalResults, int startIndex)
          Create a new resources response from the provided list.
 
Method Summary
 int getItemsPerPage()
          Retrieves the number of search results returned in this query response.
 long getStartIndex()
          Retrieves the 1-based index of the first result in the current set of search results.
 long getTotalResults()
          Retrieves the total number of results matching the Consumer query.
 Iterator<R> iterator()
          
 void marshal(Marshaller marshaller, OutputStream outputStream)
          Marshals this response using the specified Marshaller to the specified OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resources

public Resources(List<R> resourceList)
Create a new resources response from the provided list. The number of total results will be set to the size of the list and the default value of 1 for start index.

Parameters:
resourceList - The list of resources to create the response from.

Resources

public Resources(List<R> resourceList,
                 int totalResults,
                 int startIndex)
Create a new resources response from the provided list.

Parameters:
resourceList - The list of resources to create the response from.
totalResults - The total number of results matching the Consumer query
startIndex - The 1-based index of the first result in the current set of search results
Method Detail

getStartIndex

public long getStartIndex()
Retrieves the 1-based index of the first result in the current set of search results.

Returns:
The 1-based index of the first result in the current set of search results.

getTotalResults

public long getTotalResults()
Retrieves the total number of results matching the Consumer query.

Returns:
The total number of results matching the Consumer query.

getItemsPerPage

public int getItemsPerPage()
Retrieves the number of search results returned in this query response.

Returns:
The number of search results returned in this query response.

iterator

public Iterator<R> iterator()

Specified by:
iterator in interface Iterable<R extends BaseResource>

marshal

public void marshal(Marshaller marshaller,
                    OutputStream outputStream)
             throws Exception
Marshals this response using the specified Marshaller to the specified OutputStream.

Specified by:
marshal in interface SCIMResponse
Parameters:
marshaller - The Marshaller to use.
outputStream - The OutputStream to write to.
Throws:
Exception - if an error occurs while performing the marshaling.


Copyright © 2011-2012 UnboundID. All Rights Reserved.