public class

BasePropertyResource

extends Object
java.lang.Object
   ↳ com.atlassian.jira.rest.v2.entity.property.BasePropertyResource<E extends com.atlassian.jira.entity.WithId>
Known Direct Subclasses

Summary

Public Constructors
BasePropertyResource(EntityPropertyService<E> entityPropertyService, JiraAuthenticationContext authContext, JiraBaseUrls jiraBaseUrls, I18nHelper i18n, Function2<LongStringString> entityIdAndPropertyKeyToSelfFunction, EntityPropertyType entityPropertyType)
Public Methods
Response deleteProperty(String id, String propertyKey)
Response getPropertiesKeys(String id)
Returns the keys of all properties for the entity identified by the id.
Response getProperty(String entityId, String propertyKey)
Returns the value of the property with a given key from the entity identified by the the id.
Response setProperty(String id, String propertyKey, HttpServletRequest request)
Sets the value of the specified entity's property.
BasePropertyResource<E> withSelfFunction(Function2<LongStringString> selfFunction)
Returns a new instance of this class which behaves in the same way as this but uses a newly supplied function to calculate self links of properties.
Protected Methods
PropertyKeys<E> getPropertiesKeys(ApplicationUser user, String id)
EntityPropertyService.PropertyResult getProperty(ApplicationUser user, String propertyKey, String id)
EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, String propertyKey, String id)
EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, EntityPropertyService.PropertyInput propertyInput, String id)
<T> T withIdValidation(String id, Function<Long, T> idFunction)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BasePropertyResource (EntityPropertyService<E> entityPropertyService, JiraAuthenticationContext authContext, JiraBaseUrls jiraBaseUrls, I18nHelper i18n, Function2<LongStringString> entityIdAndPropertyKeyToSelfFunction, EntityPropertyType entityPropertyType)

Public Methods

public Response deleteProperty (String id, String propertyKey)

public Response getPropertiesKeys (String id)

Returns the keys of all properties for the entity identified by the id.

Parameters
id the entity from which keys will be returned.
Returns
  • a response containing EntityPropertiesKeysBean.

public Response getProperty (String entityId, String propertyKey)

Returns the value of the property with a given key from the entity identified by the the id. The user who retrieves the property is required to have permissions to read the entity.

Parameters
entityId the id of the entity from which the property will be returned.
propertyKey the key of the property to returned.
Returns

public Response setProperty (String id, String propertyKey, HttpServletRequest request)

Sets the value of the specified entity's property.

This method can used to store a custom data against the entity identified by the key or by the id. The user who stores the data is required to have permissions to edit the entity.

Parameters
id the entity's id on which the property will be set.
propertyKey the key of the entity's property. The maximum length of the key is 255 bytes.
request the request containing value of the entity's property. The value has to a valid, non-empty JSON conforming to http://tools.ietf.org/html/rfc4627. The maximum length of the property value is 32768 bytes.

public BasePropertyResource<E> withSelfFunction (Function2<LongStringString> selfFunction)

Returns a new instance of this class which behaves in the same way as this but uses a newly supplied function to calculate self links of properties.

Parameters
selfFunction function that will be used by the returned instance to calculate self links
Returns
  • a new instance

Protected Methods

protected PropertyKeys<E> getPropertiesKeys (ApplicationUser user, String id)

protected EntityPropertyService.PropertyResult getProperty (ApplicationUser user, String propertyKey, String id)

protected EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty (ApplicationUser user, String propertyKey, String id)

protected T withIdValidation (String id, Function<Long, T> idFunction)