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
NameDescription
fieldNamesList<String>

the list of field names to check

Returns
TypeDescription
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
NameDescription
limitint

the maximum number of documents to return in search results

Returns
TypeDescription
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
NameDescription
numberFoundAccuracyint

the minimum number of documents found accuracy

Returns
TypeDescription
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
NameDescription
offsetInteger

the offset of the first result to return results

Returns
TypeDescription
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
NameDescription
paramscom.google.appengine.api.search.proto.SearchServicePb.SearchParams

the SearchParams to check

Returns
TypeDescription
com.google.appengine.api.search.proto.SearchServicePb.SearchParams

this checked SearchParams

Constructors

QueryOptionsChecker()

public QueryOptionsChecker()