public class Response<T extends Entity>
extends java.lang.Object
The Response is the root object for data returned from queries performed
via the Client
find methods.
The key properties of a Response are:
getResults()
): The list of the Entity
instances found for the corresponding query,getResponseMessages()
): A collection of Message
instances pertaining to the response; these may include error conditions.Response success can be determined via the isSuccess()
and isFailure()
accessors. In the event of a failure response, the cause of the failure is
recorded in the response messages.
Client
Constructor and Description |
---|
Response(Client client,
java.util.List<T> results,
ResponseDictionary dictionary,
ResponseMessages messages) |
Modifier and Type | Method and Description |
---|---|
Client |
getClient()
Returns the
Client instance used to execute the query that generated this
response. |
ResponseMessages |
getResponseMessages()
Returns the collection of
Message instances for this response. |
java.util.List<T> |
getResults()
Gets the list of resulting
Entity instances found. |
boolean |
isFailure()
Returns true if the query failed.
|
boolean |
isSuccess()
Returns true if the query succeeded.
|
public Response(Client client, java.util.List<T> results, ResponseDictionary dictionary, ResponseMessages messages)
public java.util.List<T> getResults()
Entity
instances found.public ResponseMessages getResponseMessages()
Returns the collection of Message
instances for this response.
Messages include errors and warnings encountered during execution of the query.
ResponseMessages
,
Message
public Client getClient()
Client
instance used to execute the query that generated this
response. This allows follow-up requests with the same configuration.Client
public boolean isFailure()
isSuccess()
public boolean isSuccess()
isFailure()