@ExperimentalApi public interface

EntityPropertyQuery

com.atlassian.jira.entity.property.EntityPropertyQuery<T extends com.atlassian.jira.entity.property.EntityPropertyQuery<T>>
Known Indirect Subclasses

@ExperimentalApi

This interface is considered usable by external developers but its contracts have not stabilized.

Experimental APIs may be changed at any time before being marked @Internal or @PublicApi.

Class Overview

A query builder for requests to the JsonEntityPropertyManager.

Notes:

  • Queries must include an entity name or key at the very least.
  • Although it probably doesn't make any sense to do so, searching by the entity ID without the entity name is permitted, as long as the key is specified.
  • Null and blank values are generally not permitted, including for the key prefix search.
  • The offset is ignored unless maxResults is specified, and both are ignored for count queries.

Summary

Nested Classes
interface EntityPropertyQuery.ExecutableQuery An EntityPropertyQuery for which sufficient contraints have been provided to make the query valid. 
Public Methods
T entityId(Long entityId)
Restricts the search by the entity ID.
EntityPropertyQuery.ExecutableQuery entityName(String entityName)
Restricts the search by the entity name, which can neither be null nor blank.
EntityPropertyQuery.ExecutableQuery key(String key)
Restricts the search to the given property key, which can neither be null nor blank.
T keyPrefix(String keyPrefix)
Restricts the search to the given property key prefix, which can neither be null nor blank.
T maxResults(int maxResults)
The maximum number of results to return.
T offset(int offset)
The offset into the result list at which to begin.

Public Methods

public T entityId (Long entityId)

Restricts the search by the entity ID. This may be specified without specifying the entity name (so long as the key has been provided), but doing so probably does not make any sense.

Parameters
entityId the entity ID
Returns
  • this query
Throws
IllegalArgumentException if entityId is null

public EntityPropertyQuery.ExecutableQuery entityName (String entityName)

Restricts the search by the entity name, which can neither be null nor blank. If this is not specified, then the key is required.

Parameters
entityName the entity name; must not be null or blank
Returns
Throws
IllegalArgumentException if entityName is null or blank

public EntityPropertyQuery.ExecutableQuery key (String key)

Restricts the search to the given property key, which can neither be null nor blank. If this is not specified, then the entity name is required. This restriction is not compatible with a key prefix restriction.

Parameters
key the property key
Returns
Throws
IllegalArgumentException if key is null or blank
IllegalStateException if keyPrefix(String) has already been specified

public T keyPrefix (String keyPrefix)

Restricts the search to the given property key prefix, which can neither be null nor blank. The entity name is required to use this restriction, which is not compatible with a key restriction.

Parameters
keyPrefix the property key prefix
Returns
  • this query
Throws
IllegalArgumentException if keyPrefix is null or blank
IllegalStateException if key(String) has already been specified

public T maxResults (int maxResults)

The maximum number of results to return. You must specify this value to use an offset.

Parameters
maxResults the maximum results to return. Nonsensical values like -42 are silently ignored.
Returns
  • this query

public T offset (int offset)

The offset into the result list at which to begin. You must also specify max results to use this feature.

Parameters
offset the (0-based) index offset into the complete results. Nonsensical values like -42 are silently ignored.
Returns
  • this query