Interface EntityPropertiesClient

All Known Implementing Classes:
NativeEntityPropertiesClient

public interface EntityPropertiesClient
Generic interface to get, set and delete entity properties.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deleteProperty(Entity entity, String propertyKey)
    Deletes the property for a given key and entity
    <T> T
    getProperty(Class<T> clazz, Entity entity, String propertyKey)
    Retrieves a value object of type T for the given entity and property key.
    Retrieves a set of all property keys for the given entity.
    boolean
    setProperty(Entity entity, String propertyKey, Object value)
    Sets a new property value (serializing the object to JSON first).
  • Method Details

    • getPropertyKeys

      Set<String> getPropertyKeys(Entity entity)
      Retrieves a set of all property keys for the given entity.

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

      Parameters:
      entity - The entity to look up properties for
      Returns:
      A set of all keys for the given entity
    • deleteProperty

      void deleteProperty(Entity entity, String propertyKey)
      Deletes the property for a given key and entity

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

      Parameters:
      entity - The entity for which the property will be deleted
      propertyKey - The property to delete
    • setProperty

      boolean setProperty(Entity entity, String propertyKey, Object value)
      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)

      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

      <T> T getProperty(Class<T> clazz, Entity entity, String propertyKey)
      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)

      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