Class QueryChecker


  • public final class QueryChecker
    extends Object
    Checks values of Query.
    • Constructor Summary

      Constructors 
      Constructor Description
      QueryChecker()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static String checkQuery​(String query)
      Checks that query is not null and is parsable.
      static com.google.appengine.api.search.proto.SearchServicePb.SearchParams checkValid​(com.google.appengine.api.search.proto.SearchServicePb.SearchParams params)
      Checks the search specification is valid, specifically, has a valid index specification, a non-null query, 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.
      static com.google.appengine.api.search.proto.SearchServicePb.SearchParams checkValidFast​(com.google.appengine.api.search.proto.SearchServicePb.SearchParams params)
      Performs a fast check of the search parameters.
    • Constructor Detail

      • QueryChecker

        public QueryChecker()
    • Method Detail

      • checkQuery

        public static String checkQuery​(String query)
        Checks that query is not null and is parsable.
        Parameters:
        query - the query to check
        Returns:
        the checked query
        Throws:
        SearchQueryException - if the query is not parsable
        IllegalArgumentException - if the query is too long
      • checkValid

        public static com.google.appengine.api.search.proto.SearchServicePb.SearchParams checkValid​(com.google.appengine.api.search.proto.SearchServicePb.SearchParams params)
        Checks the search specification is valid, specifically, has a valid index specification, a non-null query, 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.
        Parameters:
        params - the SearchParams to check
        Returns:
        this checked SearchParams
        Throws:
        IllegalArgumentException - if some part of the specification is invalid
        SearchQueryException - if the query is unparsable
      • checkValidFast

        public static com.google.appengine.api.search.proto.SearchServicePb.SearchParams checkValidFast​(com.google.appengine.api.search.proto.SearchServicePb.SearchParams params)
        Performs a fast check of the search parameters. This method does not check if the query stored in the parameters parses.
        Parameters:
        params - the search parameters to check
        Returns:
        this checked SearchParams
        Throws:
        IllegalArgumentException - if parameters are not valid