Package com.atlassian.jira.issue.search
Class SearchRequest
java.lang.Object
com.atlassian.jira.issue.search.SearchRequest
- All Implemented Interfaces:
Favourite
,SharedEntity
,Serializable
- Direct Known Subclasses:
MockJqlSearchRequest
A shareable representation of a search for issues. Officially known as a "Filter" or "Saved Filter".
This class binds the Query
, which is used to perform the actual search, and
the saved information (such as name, description), and any permissions that may be associated with the saved search
together.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.sharing.SharedEntity
SharedEntity.Identifier, SharedEntity.SharePermissions, SharedEntity.TypeDescriptor<S extends SharedEntity>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionA no-arg constructor that will build a SearchRequest with an emptyQuery
, this will be a search that will find all issues with the default system sorting .SearchRequest
(SearchRequest oldRequest) Used to create a SearchRequest that copies all the information from the old search request.SearchRequest
(Query query) Creates a SearchRequest with the specifiedQuery
and no other attributes.SearchRequest
(Query query, ApplicationUser owner, String name, String description) Build a SearchRequest with the provided attributes, this can be used if you want to create a SearchRequest that can be persisted.SearchRequest
(Query query, ApplicationUser owner, String name, String description, Long id, long favouriteCount) Build a SearchRequest with the provided attributes.SearchRequest
(Query query, String ownerUserName, String name, String description) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionboolean
char
Get the delimiter being used when exporting to CSV.A general description of the entity.The type of entity it is.The number of users who have marked this entity as one of their favourites.getId()
The id of the entity.getName()
The name of the entity.getOwner()
The permissions for this entity.getQuery()
Gets the SearchQuery that defines the search that will be performed for this SearchRequest.int
hashCode()
boolean
isLoaded()
boolean
boolean
void
setCsvDelimiter
(char csvDelimiter) Set the delimiter being used when exporting to CSV.void
setDescription
(String description) protected void
setFavouriteCount
(Long favouriteCount) void
setModified
(boolean modified) void
void
setOwner
(ApplicationUser owner) Set the owner of the SearchRequest.void
setOwnerUserName
(String ownerUserName) Deprecated.UsesetOwner(com.atlassian.jira.user.ApplicationUser)
instead.void
setPermissions
(SharedEntity.SharePermissions sharePermissions) void
void
setUseColumns
(boolean useColumns) void
setWithBom
(boolean withBom) toString()
boolean
-
Field Details
-
ENTITY_TYPE
-
-
Constructor Details
-
SearchRequest
public SearchRequest()A no-arg constructor that will build a SearchRequest with an emptyQuery
, this will be a search that will find all issues with the default system sorting . You can then use the setter methods to set the attributes you wish this SearchRequest to contain. -
SearchRequest
Creates a SearchRequest with the specifiedQuery
and no other attributes. This can be used to create a programtic SearchRequest that can be used to perform a search but is not ready to be saved.- Parameters:
query
- provides the details of the search that will be performed with this SearchRequest.
-
SearchRequest
Used to create a SearchRequest that copies all the information from the old search request. This includes the name, description, author, id, favCount and the SearchQuery.- Parameters:
oldRequest
- defines all the attributes that this SearchRequest will contain.
-
SearchRequest
Build a SearchRequest with the provided attributes, this can be used if you want to create a SearchRequest that can be persisted.- Parameters:
query
- defines what this SearchRequest will search for.owner
- the owner, user who initially create the request.name
- the name associated with this SearchRequest, can be set even if this is not persistent yet.description
- the description associated with this SearchRequest, can be set even if this is not persistent yet. filter.
-
SearchRequest
public SearchRequest(Query query, ApplicationUser owner, String name, String description, Long id, long favouriteCount) Build a SearchRequest with the provided attributes.- Parameters:
query
- defines what this SearchRequest will search for.owner
- the owner, user who initially create the request.name
- the name associated with this SearchRequest, can be set even if this is not persistent yet.description
- the description associated with this SearchRequest, can be set even if this is not persistent yet.id
- the persistent id of the SearchRequest, null if the SearchRequest is not persistent.favouriteCount
- the number of users that have this filter as a favortie, will only be set if this is a persistent filter.
-
SearchRequest
Deprecated.UseSearchRequest(com.atlassian.query.Query, com.atlassian.jira.user.ApplicationUser, String, String)
instead. Since v6.0.Build a SearchRequest with the provided attributes, this can be used if you want to create a SearchRequest that can be persisted.
- Parameters:
query
- defines what this SearchRequest will search for.ownerUserName
- the owner, user who initially create the request.name
- the name associated with this SearchRequest, can be set even if this is not persistent yet.description
- the description associated with this SearchRequest, can be set even if this is not persistent yet. filter.
-
SearchRequest
public SearchRequest(Query query, String ownerUserName, String name, String description, Long id, long favouriteCount) Deprecated.UseSearchRequest(com.atlassian.query.Query, com.atlassian.jira.user.ApplicationUser, String, String, Long, long)
instead. Since v6.0.Build a SearchRequest with the provided attributes.
- Parameters:
query
- defines what this SearchRequest will search for.ownerUserName
- the owner, user who initially create the request.name
- the name associated with this SearchRequest, can be set even if this is not persistent yet.description
- the description associated with this SearchRequest, can be set even if this is not persistent yet.id
- the persistent id of the SearchRequest, null if the SearchRequest is not persistent.favouriteCount
- the number of users that have this filter as a favortie, will only be set if this is a persistent filter.
-
-
Method Details
-
getQuery
Gets the SearchQuery that defines the search that will be performed for this SearchRequest.- Returns:
- the SearchQuery that defines the search that will be performed for this SearchRequest, not null.
-
setQuery
-
getCsvDelimiter
public char getCsvDelimiter()Get the delimiter being used when exporting to CSV.- Returns:
- character being used when exporting to CSV.
-
setCsvDelimiter
public void setCsvDelimiter(char csvDelimiter) Set the delimiter being used when exporting to CSV.- Parameters:
csvDelimiter
- defines character being used when exporting to CSV.
-
getName
Description copied from interface:SharedEntity
The name of the entity.- Specified by:
getName
in interfaceSharedEntity
- Returns:
- the name. Must not be null or empty.
-
setName
-
getId
Description copied from interface:SharedEntity
The id of the entity.- Specified by:
getId
in interfaceSharedEntity
- Returns:
- the id. May be null if not yet persisted. Some components may not accept a non-persisted entity.
-
getPermissions
Description copied from interface:SharedEntity
The permissions for this entity.- Specified by:
getPermissions
in interfaceSharedEntity
- Returns:
- the permissions object. Must not be null.
-
getDescription
Description copied from interface:SharedEntity
A general description of the entity.- Specified by:
getDescription
in interfaceSharedEntity
- Returns:
- the description. May be null or empty.
-
getOwner
- Specified by:
getOwner
in interfaceSharedEntity
-
getOwnerUserName
- Specified by:
getOwnerUserName
in interfaceSharedEntity
- Returns:
- The user name of the user who owns this entity. May be null for anonymous user.
-
setDescription
-
setFavouriteCount
-
getFavouriteCount
Description copied from interface:Favourite
The number of users who have marked this entity as one of their favourites.- Specified by:
getFavouriteCount
in interfaceFavourite
- Returns:
- long the user count
-
setOwner
Set the owner of the SearchRequest.- Parameters:
owner
- the user who is the search requests owner.
-
setOwnerUserName
Deprecated.UsesetOwner(com.atlassian.jira.user.ApplicationUser)
instead. Since v6.0. Set the owner of the SearchRequest.- Parameters:
ownerUserName
- the name of the user who is the search requests owner.
-
isModified
public boolean isModified() -
setModified
public void setModified(boolean modified) -
isLoaded
public boolean isLoaded() -
useColumns
public boolean useColumns()- Returns:
- true if this SearchRequest should be displayed using the saved column layout, false otherwise
-
setUseColumns
public void setUseColumns(boolean useColumns) -
setWithBom
public void setWithBom(boolean withBom) -
isWithBom
public boolean isWithBom() -
toString
-
equals
-
hashCode
public int hashCode() -
getEntityType
Description copied from interface:SharedEntity
The type of entity it is. Examples include SearchRequest ("SearchRequest") and PortalPage ("PortalPage")- Specified by:
getEntityType
in interfaceSharedEntity
- Returns:
- the type of entity.
-
SearchRequest(com.atlassian.query.Query, com.atlassian.jira.user.ApplicationUser, String, String)
instead.