@PublicApi public class

SearchRequest

extends Object
implements SharedEntity
java.lang.Object
   ↳ com.atlassian.jira.issue.search.SearchRequest
Known Direct Subclasses

@PublicApi

This class is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

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.

Summary

Fields
public static final TypeDescriptor<SearchRequest> ENTITY_TYPE
Public Constructors
SearchRequest()
A no-arg constructor that will build a SearchRequest with an empty Query, this will be a search that will find all issues with the default system sorting .
SearchRequest(Query query)
Creates a SearchRequest with the specified Query and no other attributes.
SearchRequest(SearchRequest oldRequest)
Used to create a SearchRequest that copies all the information from the old search request.
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)
This constructor is deprecated. Use SearchRequest(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.
SearchRequest(Query query, String ownerUserName, String name, String description, Long id, long favouriteCount)
This constructor is deprecated. Use SearchRequest(com.atlassian.query.Query, com.atlassian.jira.user.ApplicationUser, String, String, Long, long) instead. Since v6.0. Build a SearchRequest with the provided attributes.
Public Methods
boolean equals(Object o)
String getDescription()
A general description of the entity.
final TypeDescriptor<SearchRequest> getEntityType()
The type of entity it is.
Long getFavouriteCount()
The number of users who have marked this entity as one of their favourites.
Long getId()
The id of the entity.
String getName()
The name of the entity.
ApplicationUser getOwner()
String getOwnerUserName()
SharedEntity.SharePermissions getPermissions()
The permissions for this entity.
@Nonnull Query getQuery()
Gets the SearchQuery that defines the search that will be performed for this SearchRequest.
int hashCode()
boolean isLoaded()
boolean isModified()
void setDescription(String description)
void setModified(boolean modified)
void setName(String name)
void setOwner(ApplicationUser owner)
Set the owner of the SearchRequest.
void setOwnerUserName(String ownerUserName)
This method is deprecated. Use setOwner(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Set the owner of the SearchRequest.
void setPermissions(SharedEntity.SharePermissions sharePermissions)
void setQuery(Query query)
void setUseColumns(boolean useColumns)
String toString()
boolean useColumns()
Protected Methods
void setFavouriteCount(Long favouriteCount)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.favourites.Favourite
From interface com.atlassian.jira.sharing.SharedEntity

Fields

public static final TypeDescriptor<SearchRequest> ENTITY_TYPE

Public Constructors

public SearchRequest ()

A no-arg constructor that will build a SearchRequest with an empty Query, 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.

public SearchRequest (Query query)

Creates a SearchRequest with the specified Query 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.

public SearchRequest (SearchRequest oldRequest)

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.

public 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.

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.

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.

public SearchRequest (Query query, String ownerUserName, String name, String description)

This constructor is deprecated.
Use SearchRequest(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.

public SearchRequest (Query query, String ownerUserName, String name, String description, Long id, long favouriteCount)

This constructor is deprecated.
Use SearchRequest(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.

Public Methods

public boolean equals (Object o)

public String getDescription ()

A general description of the entity.

Returns
  • the description. May be null or empty.

public final TypeDescriptor<SearchRequest> getEntityType ()

The type of entity it is. Examples include SearchRequest ("SearchRequest") and PortalPage ("PortalPage")

Returns
  • the type of entity.

public Long getFavouriteCount ()

The number of users who have marked this entity as one of their favourites.

Returns
  • long the user count

public Long getId ()

The id of the entity.

Returns
  • the id. May be null if not yet persisted. Some components may not accept a non-persisted entity.

public String getName ()

The name of the entity.

Returns
  • the name. Must not be null or empty.

public ApplicationUser getOwner ()

public String getOwnerUserName ()

public SharedEntity.SharePermissions getPermissions ()

The permissions for this entity.

Returns
  • the permissions object. Must not be null.

@Nonnull public Query 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.

public int hashCode ()

public boolean isLoaded ()

public boolean isModified ()

public void setDescription (String description)

public void setModified (boolean modified)

public void setName (String name)

public void setOwner (ApplicationUser owner)

Set the owner of the SearchRequest.

Parameters
owner the user who is the search requests owner.

public void setOwnerUserName (String ownerUserName)

This method is deprecated.
Use setOwner(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.

public void setPermissions (SharedEntity.SharePermissions sharePermissions)

public void setQuery (Query query)

public void setUseColumns (boolean useColumns)

public String toString ()

public boolean useColumns ()

Returns
  • true if this SearchRequest should be displayed using the saved column layout, false otherwise

Protected Methods

protected void setFavouriteCount (Long favouriteCount)