com.atlassian.jira.issue.search
Class SearchContextImpl

java.lang.Object
  extended by com.atlassian.jira.issue.search.SearchContextImpl
All Implemented Interfaces:
SearchContext

public class SearchContextImpl
extends Object
implements SearchContext


Field Summary
protected  List<String> issueTypeIds
           
protected  List<IssueType> issueTypes
           
protected  List projectCategoryIds
           
protected  List<Long> projectIds
           
protected  List<Project> projects
           
 
Constructor Summary
SearchContextImpl()
           
SearchContextImpl(List projectCategoryIds, List projectIds, List issueTypeIds)
           
SearchContextImpl(SearchContext searchContext)
           
 
Method Summary
 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
 org.ofbiz.core.entity.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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

projectCategoryIds

protected List projectCategoryIds

projectIds

protected List<Long> projectIds

issueTypeIds

protected List<String> issueTypeIds

projects

protected List<Project> projects

issueTypes

protected List<IssueType> issueTypes
Constructor Detail

SearchContextImpl

public SearchContextImpl()

SearchContextImpl

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

SearchContextImpl

public SearchContextImpl(SearchContext searchContext)
Method Detail

isForAnyProjects

public boolean isForAnyProjects()
Description copied from interface: SearchContext
Returns whether the context is global or not. A context is global when there are no project restrictions and no project category restrictions.

Specified by:
isForAnyProjects in interface SearchContext
Returns:
boolean

isForAnyIssueTypes

public boolean isForAnyIssueTypes()
Description copied from interface: SearchContext
Returns true if no specific issue types have been selected

Specified by:
isForAnyIssueTypes in interface SearchContext
Returns:
boolean

isSingleProjectContext

public boolean isSingleProjectContext()
Description copied from interface: SearchContext
Returns true if there is exactly one Project in this SearchContext.

Specified by:
isSingleProjectContext in interface SearchContext
Returns:
true if there is exactly one Project in this SearchContext.

getSingleProject

public Project getSingleProject()
Description copied from interface: SearchContext
Returns the single Project for this SearchContext. You should first call SearchContext.isSingleProjectContext() to check if this is valid.

Specified by:
getSingleProject in interface SearchContext
Returns:
the single Project for this SearchContext.
See Also:
SearchContext.isSingleProjectContext()

getProjectCategoryIds

public List getProjectCategoryIds()
Description copied from interface: SearchContext
Returns selected categories

Specified by:
getProjectCategoryIds in interface SearchContext
Returns:
Empty list if no categories were selected

getProjectIds

public List<Long> getProjectIds()
Description copied from interface: SearchContext
Project ids as Longs.

Specified by:
getProjectIds in interface SearchContext
Returns:
List of Long objects, possibly empty.

getOnlyProject

public org.ofbiz.core.entity.GenericValue getOnlyProject()
Description copied from interface: SearchContext
Returns the single Project for this SearchContext. You should first call SearchContext.isSingleProjectContext() to check if this is valid.

Specified by:
getOnlyProject in interface SearchContext
Returns:
the single Project for this SearchContext.

getIssueTypeIds

public List<String> getIssueTypeIds()
Description copied from interface: SearchContext
Issue ids as Strings

Specified by:
getIssueTypeIds in interface SearchContext
Returns:
List of issue type ids possibly empty.

getAsIssueContexts

public List<IssueContext> getAsIssueContexts()
Description copied from interface: SearchContext
Gets the search context as a list of IssueContext objects

Specified by:
getAsIssueContexts in interface SearchContext
Returns:
List of IssueContext. If no issue types or projects selected. A blank issue context is returned. Never null.

verify

public void verify()
Description copied from interface: SearchContext
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.

Specified by:
verify in interface SearchContext

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getProjects

public List<Project> getProjects()
Description copied from interface: SearchContext
Returns project objects in this SearchContext

Specified by:
getProjects in interface SearchContext
Returns:
List of Project. If no projects are selected, returns an empty list.

getIssueTypes

public List<IssueType> getIssueTypes()
Description copied from interface: SearchContext
Returns issue types objects in this SearchContext

Specified by:
getIssueTypes in interface SearchContext
Returns:
List of IssueType. If no issue types are selected, returns an empty list


Copyright © 2002-2013 Atlassian. All Rights Reserved.