Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / search / AddResponse.java
blob3647b5e0ab8dddcc3cdb248f6d083951ef918553
1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com.google.appengine.api.search;
5 import java.util.List;
7 /**
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 {
17 /**
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
25 * none was supplied
27 protected AddResponse(List<OperationResult> results, List<String> ids) {
28 super(results, ids);
31 /**
32 * @return an unmodifiable list of Ids
34 public List<String> getIds() {
35 return getDocumentIds();
38 @Override
39 public String toString() {
40 return String.format("AddResponse(results=%s, ids=%s)",
41 Util.iterableToString(getResults(), 0), Util.iterableToString(getIds(), 0));