|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.appengine.api.search.checkers.QueryOptionsChecker
public final class QueryOptionsChecker
Checks values of QueryOptions
.
Field Summary | |
---|---|
static int |
DEFAULT_LIMIT
The default limit on the number of documents to return in results. |
static int |
DEFAULT_NUMBER_FOUND_ACCURACY
The default found count accuracy. |
static int |
MAXIMUM_LIMIT
The maximum number of documents that can be requested to be returned in search results. |
static int |
MAXIMUM_NUMBER_FOUND_ACCURACY
The maximum number found accuracy that can be requested. |
static int |
MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN
The maximum number of names of fields to return in results. |
static int |
MAXIMUM_OFFSET
The maximum offset into all search results to return results from. |
Constructor Summary | |
---|---|
QueryOptionsChecker()
|
Method Summary | |
---|---|
static java.util.List<java.lang.String> |
checkFieldNames(java.util.List<java.lang.String> fieldNames)
Checks that there are at most #MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN field names and that each field name is valid. |
static int |
checkLimit(int limit)
Checks whether the number of documents to return is between 1 and the maximum. |
static int |
checkNumberFoundAccuracy(int numberFoundAccuracy)
Checks whether the minimum number of documents found accuracy is between 1 and the maximum. |
static java.lang.Integer |
checkOffset(java.lang.Integer offset)
Checks whether the offset is between 0 and the maximum. |
static SearchParams |
checkValid(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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAXIMUM_OFFSET
public static final int MAXIMUM_LIMIT
public static final int DEFAULT_LIMIT
public static final int MAXIMUM_NUMBER_FOUND_ACCURACY
public static final int DEFAULT_NUMBER_FOUND_ACCURACY
public static final int MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN
Constructor Detail |
---|
public QueryOptionsChecker()
Method Detail |
---|
public static int checkLimit(int limit)
limit
- the maximum number of documents to return in search
results
java.lang.IllegalArgumentException
- if the number of documents to return
is out of rangepublic static java.lang.Integer checkOffset(java.lang.Integer offset)
offset
- the offset of the first result to return
results
java.lang.IllegalArgumentException
- if the offset is out of rangepublic static int checkNumberFoundAccuracy(int numberFoundAccuracy)
numberFoundAccuracy
- the minimum number of documents found
accuracy
java.lang.IllegalArgumentException
- if the minimum is out of rangepublic static java.util.List<java.lang.String> checkFieldNames(java.util.List<java.lang.String> fieldNames)
fieldNames
- the list of field names to check
java.lang.IllegalArgumentException
- if the field names list size exceeds the
maximum, or some name is invalidpublic static SearchParams checkValid(SearchParams params)
params
- the SearchParams to check
java.lang.IllegalArgumentException
- if some part of the specification is
invalid
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |