Class QueryOptionsChecker (2.0.0)

public final class QueryOptionsChecker

Inheritance

java.lang.Object > QueryOptionsChecker

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 List<String>

the list of field names to check

Returns
Type Description
List<String>

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 int

the maximum number of documents to return in search results

Returns
Type Description
int

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 int

the minimum number of documents found accuracy

Returns
Type Description
int

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 Integer

the offset of the first result to return results

Returns
Type Description
Integer

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()