public class GenericResponse extends Object implements QueryResponse, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentIndex |
protected List |
results |
| Constructor and Description |
|---|
GenericResponse()
Creates an empty BaseResponse.
|
GenericResponse(List list)
Creates a BaseResponse with a single result list.
|
GenericResponse(QueryResponse response)
Creates a response that it a shallow copy of another response.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBatchUpdateCount(int[] resultCount) |
void |
addResultList(List list) |
void |
addUpdateCount(int resultCount) |
void |
clear()
Clears any previously collected information.
|
List |
currentList()
Returns a List under the current iterator position.
|
int[] |
currentUpdateCount()
Returns an update count under the current iterator position.
|
List |
firstList()
A utility method for quickly retrieving the first list in the response.
|
int[] |
firstUpdateCount()
A utility method for quickly retrieving the first update count from the response.
|
boolean |
isList()
Returns whether current iteration result is a list or an update count.
|
boolean |
next()
Rewinds response iterator to the next result, returning true if it is available.
|
void |
replaceResult(Object oldResult,
Object newResult)
Replaces previously stored result with a new result.
|
void |
reset()
Restarts response iterator.
|
int |
size()
Returns a number of results in the response.
|
protected List results
protected transient int currentIndex
public GenericResponse()
public GenericResponse(List list)
public GenericResponse(QueryResponse response)
public List firstList()
QueryResponsefirstList in interface QueryResponsepublic int[] firstUpdateCount()
QueryResponsefirstUpdateCount in interface QueryResponsepublic List currentList()
QueryResponseQueryResponse.isList() to check
the result type before calling this method.currentList in interface QueryResponsepublic int[] currentUpdateCount()
QueryResponseQueryResponse.isList() to check the result type before calling this
method.currentUpdateCount in interface QueryResponsepublic boolean isList()
QueryResponseisList in interface QueryResponsepublic boolean next()
QueryResponsenext in interface QueryResponsepublic void reset()
QueryResponsereset in interface QueryResponsepublic int size()
QueryResponsesize in interface QueryResponsepublic void clear()
public void addBatchUpdateCount(int[] resultCount)
public void addUpdateCount(int resultCount)
public void addResultList(List list)
Copyright © 2001–2023 Apache Cayenne. All rights reserved.