Class QueryContextConverter
java.lang.Object
com.atlassian.jira.bc.issue.search.QueryContextConverter
The utility class for converting a
QueryContext
into a SearchContext
.
This conversion only makes sense if the Query
the QueryContext was generated from fits the simple navigator.- Since:
- v4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetQueryContext
(SearchContext searchContext) Converts aSearchContext
representation into theQueryContext
of a search context.getSearchContext
(QueryContext queryContext) Converts aQueryContext
into aSearchContext
.
-
Constructor Details
-
QueryContextConverter
public QueryContextConverter()
-
-
Method Details
-
getQueryContext
Converts aSearchContext
representation into theQueryContext
of a search context.As search contexts represented by
QueryContext
s is a super set of those represented bySearchContext
, this coversion will always be valid and never return null.- Parameters:
searchContext
- the context to convert into aQueryContext
- Returns:
- the context represented by a
QueryContext
. Never Null.
-
getSearchContext
Converts aQueryContext
into aSearchContext
. If the conversion does not make sense, null is returned.If you would like to know if this method will correctly generate a SearchContext you should call
SearchService#doesQueryFitFilterForm(com.atlassian.crowd.embedded.api.User, com.atlassian.query.Query)
.- Parameters:
queryContext
- the QueryContext to convert into a SearchContext, if null then a null SearchContext is returned.- Returns:
- the SearchContext generated from the QueryContext, this will be null if we are unable to correctly generate a SearchContext.
-