Class FacetQueryChecker


  • public final class FacetQueryChecker
    extends Object
    Provides checks for faceted search related query options.
    • Method Detail

      • checkDiscoveryLimit

        public static int checkDiscoveryLimit​(int value)
        Checks that a discovery limit is valid. The value must be greater than 0 and less than SearchApiLimits.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

        public static String checkFacetValue​(String value)
        Checks that a value constraint is valid. The Value length must be at least 1 and less than SearchApiLimits.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

        public static Integer checkDepth​(Integer value)
        Checks that a facet depth option is valid. The facet depth must be greater than 0 and less than SearchApiLimits.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

        public static Integer checkDiscoveryValueLimit​(Integer value)
        Checks whether discovery value limit option is valid. The discovery value limit must be greater than 0 and less than SearchApiLimits.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

        public static Integer checkValueLimit​(Integer value)
        Checks whether a value limit option is valid. The value limit must be greater than 0 and less than SearchApiLimits.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