1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com
.google
.appengine
.api
.search
;
8 * Represents a result of adding a list of objects (documents or queries)
9 * to an index. The response contains a list of {@link OperationResult}
10 * indicating success or not of adding each of the objects, and a list
11 * of Id of the objects which are those given in the request or allocated
12 * by the search service to those objects which do not have an Id supplied.
15 public class AddResponse
extends AddDocumentsResponse
{
18 * Creates a {@link AddResponse} by specifying a list of
19 * {@link OperationResult} and a list of document or query ids.
21 * @param results a list of {@link OperationResult} that indicate the
22 * success or not adding each object
23 * @param ids a list of Id of objects that were requested to be
24 * added. The search service may supply Ids for those objects where
27 protected AddResponse(List
<OperationResult
> results
, List
<String
> ids
) {
32 * @return an unmodifiable list of Ids
34 public List
<String
> getIds() {
35 return getDocumentIds();
39 public String
toString() {
40 return String
.format("AddResponse(results=%s, ids=%s)",
41 Util
.iterableToString(getResults(), 0), Util
.iterableToString(getIds(), 0));