Class DefaultIndexedInputHelper<T>

java.lang.Object
com.atlassian.jira.issue.search.searchers.util.DefaultIndexedInputHelper<T>
All Implemented Interfaces:
IndexedInputHelper
Direct Known Subclasses:
IssueConstantIndexedInputHelper, VersionIndexedInputHelper

@NonInjectableComponent public class DefaultIndexedInputHelper<T> extends Object implements IndexedInputHelper
The default implementation for the IndexedInputHelper.

This class should be constructed as needed and not injected, as the IndexInfoResolver is only relevant to specific field(s).

Since:
v4.0
  • Constructor Details

  • Method Details

    • getAllIndexValuesForMatchingClauses

      public Set<String> getAllIndexValuesForMatchingClauses(ApplicationUser searcher, ClauseNames jqlClauseNames, Query query)
      Description copied from interface: IndexedInputHelper
      Retrieves the index values for the clauses in the SearchRequest. Function Operands are expanded to their values.
      Specified by:
      getAllIndexValuesForMatchingClauses in interface IndexedInputHelper
      Parameters:
      searcher - the user running the search
      jqlClauseNames - the names of the clauses on which to retreive the values.
      query - the search criteria used to populate the field values holder.
      Returns:
      a set of strings containing the index values of the clause values. Never null.
    • getAllNavigatorValuesForMatchingClauses

      public Set<String> getAllNavigatorValuesForMatchingClauses(ApplicationUser searcher, ClauseNames jqlClauseNames, Query query)
      Description copied from interface: IndexedInputHelper
      Retreives the navigator id values for the values in the clauses. If there is a flag associated with a function operand then that flag is returned, otherwise the function operand is expanded to its index values.
      Specified by:
      getAllNavigatorValuesForMatchingClauses in interface IndexedInputHelper
      Parameters:
      searcher - the user running the search
      jqlClauseNames - the names of the clauses on which to retreive the values.
      query - the search criteria used to populate the field values holder.
      Returns:
      a set of strings containing the navigator values of the clause values. Never Null.
    • getClauseForNavigatorValues

      public Clause getClauseForNavigatorValues(String clauseName, Set<String> values)
      Description copied from interface: IndexedInputHelper
      Converts a set of Navigator value strings into a Clause that will match at least one of the specified values for the given field.

      Note: where possible, the helper should try to create a clause, even when the value strings do not make sense in the given domain. That is, it is preferred that a non-validating clause gets created than no clause at all.

      Specified by:
      getClauseForNavigatorValues in interface IndexedInputHelper
      Parameters:
      clauseName - the name of the clause to generate
      values - a set of Navigator value strings; may contain flag values. May not be null.
      Returns:
      a clause that will match any of the values specified; null if no values were specified.
    • createOperand

      protected Operand createOperand(String stringValue)
      Resolve this string representation of a navigator value (known not to be a field flag) into an operand to be used in a clause. Override this to provide domain-specific resolution (e.g. resolve version ids to names). Default implementation delegates to createSingleValueOperandFromId(java.lang.String)
      Parameters:
      stringValue - the navigator value as a string e.g. 123
      Returns:
      the operand which best represents this navigator value - either a string name or the id or whatever.
    • createSingleValueOperandFromId

      protected SingleValueOperand createSingleValueOperandFromId(String stringValue)
      Resolve this string representation of a navigator value (known not to be a field flag) into an operand to be used in a clause (assuming that this is a single value operand). Override this to provide domain-specific resolution (e.g. resolve version ids to names).
      Parameters:
      stringValue - the navigator value as a string e.g. 123
      Returns:
      the operand which best represents this navigator value - either a string name or the id or whatever.