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
;
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
;
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"));
34 public Iterator
<Index
> iterator() {
35 return indexes
.iterator();
39 * @return an unmodifiable list of {@link Index} that an application has
42 public List
<Index
> getIndexes() {
47 public String
toString() {
48 return String
.format("ListIndexesResponse(indexes=%s)", Util
.iterableToString(indexes
, 0));