Package org.labkey.remoteapi.query
Class SaveRowsResponse
java.lang.Object
org.labkey.remoteapi.CommandResponse
org.labkey.remoteapi.query.SaveRowsResponse
Response object used for commands that derive from SaveRowsCommand.
This response object provides helper methods for accessing the important
bits of the parsed response data.
-
Constructor Summary
ConstructorsConstructorDescriptionSaveRowsResponse
(String text, int statusCode, String contentType, org.json.JSONObject json, HasRequiredVersion hasRequiredVersion) Constructs a new SaveRowsResponse given the response text and status code -
Method Summary
Modifier and TypeMethodDescriptionReturns the 'command' response property.Returns the 'queryName' response property.getRows()
Returns the list of rows from the parsed response data.Returns the 'rowsAffected' response property.Returns the 'schemaName' response property.Methods inherited from class org.labkey.remoteapi.CommandResponse
findObject, getContentType, getParsedData, getProperty, getProperty, getStatusCode, getText
-
Constructor Details
-
SaveRowsResponse
public SaveRowsResponse(String text, int statusCode, String contentType, org.json.JSONObject json, HasRequiredVersion hasRequiredVersion) Constructs a new SaveRowsResponse given the response text and status code- Parameters:
text
- The response text.statusCode
- The HTTP status code.contentType
- The Content-Type header value.json
- The parsed JSONObject (or null if JSON was not returned)hasRequiredVersion
- An object that implements HasRequiredVersion
-
-
Method Details
-
getRowsAffected
Returns the 'rowsAffected' response property.- Returns:
- The number of rows affected by the command, or null if this property was not present in the response.
-
getSchemaName
Returns the 'schemaName' response property.- Returns:
- The schema name affected by the command, or null if this property was not present in the response.
-
getQueryName
Returns the 'queryName' response property.- Returns:
- The query name affected by the command, or null if this property was not present in the response.
-
getCommand
Returns the 'command' response property.- Returns:
- The command executed, or null if this property was not present in the response.
-
getRows
Returns the list of rows from the parsed response data. Note that numbers in the map values will be either of type Double or type Long depending on the presence of a decimal point. The most reliable way to work with them is to use the Number class. For example:for (Map<String, Object> row : response.getRows()) { Number key = (Number)row.get("Key"); // use Number.intValue(), doubleValue(), longValue(), etc to get various primitive types }
- Returns:
- The list of rows (each row is a Map), or null if the rows list was not included in the response.
-