public final class QueryOptionsChecker
extends java.lang.Object
QueryOptions
.Constructor and Description |
---|
QueryOptionsChecker() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static int checkLimit(int limit)
limit
- the maximum number of documents to return in search
resultsjava.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
resultsjava.lang.IllegalArgumentException
- if the offset is out of rangepublic static int checkNumberFoundAccuracy(int numberFoundAccuracy)
numberFoundAccuracy
- the minimum number of documents found
accuracyjava.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 checkjava.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 checkjava.lang.IllegalArgumentException
- if some part of the specification is
invalid