org.labkey.remoteapi.query

## Class SaveRowsResponse

- java.lang.Object
- - org.labkey.remoteapi.CommandResponse
  - - org.labkey.remoteapi.query.SaveRowsResponse

-     public class SaveRowsResponse
      extends CommandResponse

  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

    Constructors
    Constructor and Description
    `SaveRowsResponse(java.lang.String text, int statusCode, java.lang.String contentType, org.json.simple.JSONObject json, SaveRowsCommand sourceCommand)` Constructs a new SaveRowsResponse given the response text and status code

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCommand()` Returns the 'command' response property.
    `java.lang.String` | `getQueryName()` Returns the 'queryName' response property.
    `java.util.List<java.util.Map<java.lang.String,java.lang.Object>>` | `getRows()` Returns the list of rows from the parsed response data.
    `java.lang.Number` | `getRowsAffected()` Returns the 'rowsAffected' response property.
    `java.lang.String` | `getSchemaName()` Returns the 'schemaName' response property.

    - ### Methods inherited from class org.labkey.remoteapi.CommandResponse

      `findObject, getContentType, getParsedData, getProperty, getProperty, getRequiredVersion, getSourceCommand, getStatusCode, getText`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SaveRowsResponse

          public SaveRowsResponse(java.lang.String text,
                                  int statusCode,
                                  java.lang.String contentType,
                                  org.json.simple.JSONObject json,
                                  SaveRowsCommand sourceCommand)

      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).
        `sourceCommand` - A copy of the command that created this response

  - ### Method Detail

    - #### getRowsAffected

          public java.lang.Number 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

          public java.lang.String 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

          public java.lang.String 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

          public java.lang.String getCommand()

      Returns the 'command' response property.
      Returns:
        The command executed, or null if this property was not present in the response.

    - #### getRows

          public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> 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 depedning on the prescence 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.