# Class QueryOptionsChecker (5.0.3)

    public final class QueryOptionsChecker

Checks values of [com.google.appengine.api.search.QueryOptions](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.QueryOptions).

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> QueryOptionsChecker

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### checkFieldNames(List\<String\> fieldNames)

    public static List<String> checkFieldNames(List<String> fieldNames)

Checks that there are at most

# MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN field names and

that each field name is valid.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `fieldNames` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` the list of field names to check |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` | the checked list of field names |

### checkLimit(int limit)

    public static int checkLimit(int limit)

Checks whether the number of documents to return is between 1 and the
maximum.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `limit` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` the maximum number of documents to return in search results |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | the checked number of documents to return |

### checkNumberFoundAccuracy(int numberFoundAccuracy)

    public static int checkNumberFoundAccuracy(int numberFoundAccuracy)

Checks whether the minimum number of documents found accuracy is between
1 and the maximum.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `numberFoundAccuracy` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` the minimum number of documents found accuracy |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | the checked accuracy |

### checkOffset(Integer offset)

    public static Integer checkOffset(Integer offset)

Checks whether the offset is between 0 and the maximum. Can be null.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `offset` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html` the offset of the first result to return results |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html` | the checked offset of the first result to return |

### checkValid(SearchServicePb.SearchParams params)

    public static SearchServicePb.SearchParams checkValid(SearchServicePb.SearchParams params)

Checks the search options are valid, specifically, has a non-null
number of documents to return specification, a valid cursor if present,
valid sort specification list, a valid collection of field names for
sorting, and a valid scorer specification.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `params` | `com.google.appengine.api.search.proto.SearchServicePb.SearchParams` the SearchParams to check |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.appengine.api.search.proto.SearchServicePb.SearchParams` | this checked SearchParams |

## Constructors

### QueryOptionsChecker()

    public QueryOptionsChecker()