public final class SObjectBatchResult extends Object implements Serializable
getStatusCode() for status of the specific request. The result of
the request can vary from API to API so here it is given as Object,
in most cases it will be a Map with string keys and values or other
Map as value. Requests made in JSON format hold some type information
(i.e. it is known what values are strings and what values are numbers), so in
general those will be more type friendly. Note that the responses will vary
between XML and JSON, this is due to the responses from Salesforce API being
different.
For example response for SObject record creation in JSON will be:
{
"statusCode": 201,
"result": {
"id" : "0010Y00000Ary8hQAB",
"success" : true,
"errors" : []
}
}
Which will result in getResult() returning Map created like:
{
@code
Map result = new HashMap<>();
result.put("id", "0010Y00000Ary91QAB");
result.put("success", Boolean.TRUE);
result.put("errors", Collections.emptyList());
}
Whereas using XML format the response will be:
<Result> <id>0010Y00000AryACQAZ</id> <success>true</success> </Result>
And that results in getResult() returning Map created like:
{
@code
Map result = new HashMap<>();
Map nestedResult = new HashMap<>();
result.put("Result", nestedResult);
nestedResult.put("id", "0010Y00000Ary91QAB");
nestedResult.put("success", "true");
}
Note the differences between type and nested Map one level deeper in
the case of XML.
| Constructor and Description |
|---|
SObjectBatchResult(int statusCode,
Object result) |
Apache Camel