Class QueryFactoryResult

java.lang.Object
com.atlassian.jira.jql.query.QueryFactoryResult

public final class QueryFactoryResult extends Object
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 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

      public static QueryFactoryResult createFalseResult()
      Creates a QueryFactoryResult instance that will return no results.
      Returns:
      A QueryFactoryResult instance that will return no results.
    • mergeResultsWithShould

      public static QueryFactoryResult mergeResultsWithShould(List<QueryFactoryResult> results)
      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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object