Class FacetQueryChecker
java.lang.Object
com.google.appengine.api.search.checkers.FacetQueryChecker
Provides checks for faceted search related query options.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Integer
checkDepth
(Integer value) Checks that a facet depth option is valid.static int
checkDiscoveryLimit
(int value) Checks that a discovery limit is valid.static Integer
checkDiscoveryValueLimit
(Integer value) Checks whether discovery value limit option is valid.static String
checkFacetValue
(String value) Checks that a value constraint is valid.static com.google.appengine.api.search.proto.SearchServicePb.SearchParams
checkValid
(com.google.appengine.api.search.proto.SearchServicePb.SearchParams params) Checks whether all options related to faceted search are valid.static Integer
checkValueLimit
(Integer value) Checks whether a value limit option is valid.
-
Method Details
-
checkDiscoveryLimit
public static int checkDiscoveryLimit(int value) Checks that a discovery limit is valid. The value must be greater than 0 and less thanSearchApiLimits.FACET_MAXIMUM_DISCOVERY_LIMIT
.- Parameters:
value
- the discovery limit to check- Returns:
- the discovery limit
- Throws:
IllegalArgumentException
- if the discovery limit is less than 1 or greater than SearchApiLimits#FACET_MAXIMUM_DISCOVERY_LIMIT.
-
checkFacetValue
Checks that a value constraint is valid. The Value length must be at least 1 and less thanSearchApiLimits.MAXIMUM_ATOM_LENGTH
.- Parameters:
value
- the value constraint to check- Returns:
- the value constraint
- Throws:
IllegalArgumentException
- if the Value length is less than 1 or greater than SearchApiLimits#FACET_MAXIMUM_VALUE_LENGTH.
-
checkDepth
Checks that a facet depth option is valid. The facet depth must be greater than 0 and less thanSearchApiLimits.FACET_MAXIMUM_DEPTH
.- Parameters:
value
- the facet depth option to check- Returns:
- the facet depth
- Throws:
IllegalArgumentException
- if the facet depth option is less than 1 or greater than SearchApiLimits#FACET_MAXIMUM_DEPTH.
-
checkDiscoveryValueLimit
Checks whether discovery value limit option is valid. The discovery value limit must be greater than 0 and less thanSearchApiLimits.FACET_MAXIMUM_VALUE_LIMIT
.- Parameters:
value
- the discovery value limit to check- Returns:
- the discovery value limit
- Throws:
IllegalArgumentException
- if the discovery value limit is less than 1 or greater than SearchApiLimits#FACET_MAXIMUM_VALUE_LIMIT.
-
checkValueLimit
Checks whether a value limit option is valid. The value limit must be greater than 0 and less thanSearchApiLimits.FACET_MAXIMUM_VALUE_LIMIT
.- Parameters:
value
- the value limit to check- Returns:
- the value limit
- Throws:
IllegalArgumentException
- if the value limit is less than 1 or greater than SearchApiLimits#FACET_MAXIMUM_VALUE_LIMIT.
-
checkValid
public static com.google.appengine.api.search.proto.SearchServicePb.SearchParams checkValid(com.google.appengine.api.search.proto.SearchServicePb.SearchParams params) Checks whether all options related to faceted search are valid.- Parameters:
params
- the SearchParams to check- Returns:
- this checked SearchParams
- Throws:
IllegalArgumentException
- if some part of the specification is invalid
-