public class

SearchContextImpl

extends Object
implements SearchContext
java.lang.Object
   ↳ com.atlassian.jira.issue.search.SearchContextImpl

Summary

Fields
protected List<String> issueTypeIds
protected List<IssueType> issueTypes
protected List projectCategoryIds
protected List<Long> projectIds
protected List<Project> projects
Public Constructors
SearchContextImpl()
SearchContextImpl(List projectCategoryIds, List projectIds, List issueTypeIds)
SearchContextImpl(SearchContext searchContext)
Public Methods
boolean equals(Object o)
List<IssueContext> getAsIssueContexts()
Gets the search context as a list of IssueContext objects
List<String> getIssueTypeIds()
Issue ids as Strings
List<IssueType> getIssueTypes()
Returns issue types objects in this SearchContext
GenericValue getOnlyProject()
Returns the single Project for this SearchContext.
List getProjectCategoryIds()
Returns selected categories
List<Long> getProjectIds()
Project ids as Longs.
List<Project> getProjects()
Returns project objects in this SearchContext
Project getSingleProject()
Returns the single Project for this SearchContext.
int hashCode()
boolean isForAnyIssueTypes()
Returns true if no specific issue types have been selected
boolean isForAnyProjects()
Returns whether the context is global or not.
boolean isSingleProjectContext()
Returns true if there is exactly one Project in this SearchContext.
String toString()
void verify()
Verifies that all issue types and projects in the context actually still exists.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.search.SearchContext

Fields

protected List<String> issueTypeIds

protected List<IssueType> issueTypes

protected List projectCategoryIds

protected List<Long> projectIds

protected List<Project> projects

Public Constructors

public SearchContextImpl ()

public SearchContextImpl (List projectCategoryIds, List projectIds, List issueTypeIds)

public SearchContextImpl (SearchContext searchContext)

Public Methods

public boolean equals (Object o)

public List<IssueContext> getAsIssueContexts ()

Gets the search context as a list of IssueContext objects

Returns
  • List of IssueContext. If no issue types or projects selected. A blank issue context is returned. Never null.

public List<String> getIssueTypeIds ()

Issue ids as Strings

Returns
  • List of issue type ids possibly empty.

public List<IssueType> getIssueTypes ()

Returns issue types objects in this SearchContext

Returns
  • List of IssueType. If no issue types are selected, returns an empty list

public GenericValue getOnlyProject ()

Returns the single Project for this SearchContext. You should first call isSingleProjectContext() to check if this is valid.

Returns
  • the single Project for this SearchContext.

public List getProjectCategoryIds ()

Returns selected categories

Returns
  • Empty list if no categories were selected

public List<Long> getProjectIds ()

Project ids as Longs.

Returns
  • List of Long objects, possibly empty.

public List<Project> getProjects ()

Returns project objects in this SearchContext

Returns
  • List of Project. If no projects are selected, returns an empty list.

public Project getSingleProject ()

Returns the single Project for this SearchContext. You should first call isSingleProjectContext() to check if this is valid.

Returns
  • the single Project for this SearchContext.

public int hashCode ()

public boolean isForAnyIssueTypes ()

Returns true if no specific issue types have been selected

Returns
  • boolean

public boolean isForAnyProjects ()

Returns whether the context is global or not. A context is global when there are no project restrictions and no project category restrictions.

Returns
  • boolean

public boolean isSingleProjectContext ()

Returns true if there is exactly one Project in this SearchContext.

Returns
  • true if there is exactly one Project in this SearchContext.

public String toString ()

public void verify ()

Verifies that all issue types and projects in the context actually still exists. This might not be the case. Also removes any projects or issue types from this SearchContext that do not (any longer) exist in the backing store.