Interface SearchQuery
public interface SearchQuery
Utility class to help with creating a query string for the
SearchProvider.search(String, String) method.
Query strings will have the form: <searchString>&<param1>=<value1>&<param2>=<value2>...
- Since:
- 2.0
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionAppends string query to current query object.Builds a url-encoded queryString to use with theSearchProvider.search(String, String)method.getParameter(String name) Returns value of the parameterintgetParameter(String name, int defaultValue) Convenient method to return integer value of parameter.setParameter(String name, String value) Sets an arbitrary search parameter to the query string.
-
Field Details
-
PARAMETER_SEPARATOR
The parameter separator value- See Also:
-
-
Method Details
-
setParameter
Sets an arbitrary search parameter to the query string. If parameter with given name exists, it will be overriden- Parameters:
name- the search parameter namevalue- the search parameter value- Returns:
- a reference to this query creator
-
getParameter
Returns value of the parameter- Parameters:
name- the parameter name- Returns:
- the parameter value
-
append
Appends string query to current query object. New parameters in query will override old ones.- Parameters:
query- un-encoded query- Returns:
- the created and parsed search query
-
buildQueryString
String buildQueryString()Builds a url-encoded queryString to use with theSearchProvider.search(String, String)method.queryStringconsists of searchString and parameters.- Returns:
- queryString created by this SearchQuery.
-
getSearchString
String getSearchString()- Returns:
- the original string that user is searching for. Same as
buildQueryString()without parameters and not url-encoded
-
getParameter
Convenient method to return integer value of parameter. If parameter does not exist, or is not parsable as Integer it returnsdefaultValue.- Parameters:
name- The parameter namedefaultValue- The default value if that parameter is not specified- Returns:
- the integer value
-