Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / search / ListIndexesResponse.java
blobc2b71367282706569798348c4dd429b71679f78a
1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com.google.appengine.api.search;
5 import com.google.appengine.api.search.checkers.Preconditions;
7 import java.io.Serializable;
8 import java.util.Collections;
9 import java.util.Iterator;
10 import java.util.List;
12 /**
13 * Represents a result of executing a {@link ListIndexesRequest}. The response
14 * contains a list of {@link Index} that the application has access to.
17 public class ListIndexesResponse implements Iterable<Index>, Serializable {
18 private static final long serialVersionUID = 1189234703739911898L;
20 private final List<Index> indexes;
22 /**
23 * Creates a {@link ListIndexesResponse} by specifying a list of
24 * {@link Index} that an application has access to.
26 * @param indexes a list of {@link Index} that an application has access to
28 protected ListIndexesResponse(List<Index> indexes) {
29 this.indexes = Collections.unmodifiableList(
30 Preconditions.checkNotNull(indexes, "indexes cannot be null"));
33 @Override
34 public Iterator<Index> iterator() {
35 return indexes.iterator();
38 /**
39 * @return an unmodifiable list of {@link Index} that an application has
40 * access to
42 public List<Index> getIndexes() {
43 return indexes;
46 @Override
47 public String toString() {
48 return String.format("ListIndexesResponse(indexes=%s)", Util.iterableToString(indexes, 0));