Class NativeEntityPropertiesClient

java.lang.Object
com.codebarrel.jira.entityproperties.NativeEntityPropertiesClient
All Implemented Interfaces:
EntityPropertiesClient

public class NativeEntityPropertiesClient extends Object implements EntityPropertiesClient
  • Constructor Details

  • Method Details

    • getPropertyKeys

      public Set<String> getPropertyKeys(Entity entity)
      Description copied from interface: EntityPropertiesClient
      Retrieves a set of all property keys for the given entity.

      Note: for users, the entity key is the user key (not username)

      Specified by:
      getPropertyKeys in interface EntityPropertiesClient
      Parameters:
      entity - The entity to look up properties for
      Returns:
      A set of all keys for the given entity
    • deleteProperty

      public void deleteProperty(Entity entity, String propertyKey)
      Description copied from interface: EntityPropertiesClient
      Deletes the property for a given key and entity

      Note: for users, the entity key is the user key (not username)

      Specified by:
      deleteProperty in interface EntityPropertiesClient
      Parameters:
      entity - The entity for which the property will be deleted
      propertyKey - The property to delete
    • setProperty

      public boolean setProperty(Entity entity, String propertyKey, Object value)
      Description copied from interface: EntityPropertiesClient
      Sets a new property value (serializing the object to JSON first). The value object needs to be annotated correctly with Jackson to serialize it.

      Note: for users, the entity key is the user key (not username)

      Specified by:
      setProperty in interface EntityPropertiesClient
      Parameters:
      entity - The entity for which the property will be stored
      propertyKey - The property key under which the property will be stored
      value - The value object to store as JSON.
    • getProperty

      public <T> T getProperty(Class<T> clazz, Entity entity, String propertyKey)
      Description copied from interface: EntityPropertiesClient
      Retrieves a value object of type T for the given entity and property key.

      Note: for users, the entity key is the user key (not username)

      Specified by:
      getProperty in interface EntityPropertiesClient
      Parameters:
      clazz - The type of property to retrieve
      entity - The entity for which the property will be retrieved
      propertyKey - The property key to look up.
      Returns:
      The deserialized value object