Package com.atlassian.jira.jql.query
Class QueryFactoryResult
java.lang.Object
com.atlassian.jira.jql.query.QueryFactoryResult
Represents the result of a call to the
ClauseQueryFactory.getQuery(QueryCreationContext, com.atlassian.query.clause.TerminalClause)
method. The result contains the a Lucene Query and a flag to indicate whether or not the Lucene Query should be negated.
When the flag is set to true JIRA will automatically negate the Lucene Query when it is run in Lucene.- Since:
- v4.0
-
Constructor Summary
ConstructorsConstructorDescriptionQueryFactoryResult(org.apache.lucene.search.Query luceneQuery) Default constructor that sets mustNotOccur to false.QueryFactoryResult(org.apache.lucene.search.Query luceneQuery, boolean mustNotOccur) Create the result with the passed result and flag. -
Method Summary
Modifier and TypeMethodDescriptionstatic QueryFactoryResultCreates aQueryFactoryResultinstance that will return no results.booleanorg.apache.lucene.search.QueryinthashCode()static QueryFactoryResultmergeResultsWithShould(List<QueryFactoryResult> results) booleantoString()
-
Constructor Details
-
QueryFactoryResult
public QueryFactoryResult(org.apache.lucene.search.Query luceneQuery) Default constructor that sets mustNotOccur to false.- Parameters:
luceneQuery- the query to wrap. Must not be null.- Throws:
IllegalArgumentException- if luceneQuery is null.
-
QueryFactoryResult
public QueryFactoryResult(org.apache.lucene.search.Query luceneQuery, boolean mustNotOccur) Create the result with the passed result and flag.- Parameters:
luceneQuery- the query to add. Must not be null.mustNotOccur- the flag to add to the result.- Throws:
IllegalArgumentException- if luceneQuery is null.
-
-
Method Details
-
createFalseResult
Creates aQueryFactoryResultinstance that will return no results.- Returns:
- A
QueryFactoryResultinstance that will return no results.
-
mergeResultsWithShould
- Parameters:
results- a list of results you want to merge; must not be null or contain nulls- Returns:
- non-false results merged in a new boolean query with SHOULD. The result should never need negation, i.e.
mustNotOccur()will always be false.
-
getLuceneQuery
public org.apache.lucene.search.Query getLuceneQuery() -
mustNotOccur
public boolean mustNotOccur() -
equals
-
hashCode
public int hashCode() -
toString
-