Class BasePropertyResource<E extends WithId>

java.lang.Object
com.atlassian.jira.rest.v2.entity.property.BasePropertyResource<E>
Direct Known Subclasses:
BasePropertyWithKeyResource

public class BasePropertyResource<E extends WithId> extends Object
Since:
v6.2
  • Constructor Details

  • Method Details

    • withSelfFunction

      public BasePropertyResource<E> withSelfFunction(BiFunction<Long,String,String> 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
    • getPropertiesKeys

      public javax.ws.rs.core.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.
    • setProperty

      public javax.ws.rs.core.Response setProperty(String id, String propertyKey, javax.servlet.http.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 be a valid, non-empty JSON conforming to http://tools.ietf.org/html/rfc4627. The maximum length of the property value is 32768 bytes.
    • getProperty

      public javax.ws.rs.core.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:
      a response containing EntityPropertyBean.
    • deleteProperty

      public javax.ws.rs.core.Response deleteProperty(String id, String propertyKey)
    • getPropertiesKeys

      protected EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user, String id)
    • getProperty

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

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

    • withIdValidation

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