Interface EntityPropertiesClient
- All Known Implementing Classes:
NativeEntityPropertiesClient
public interface EntityPropertiesClient
Generic interface to get, set and delete entity properties.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteProperty(Entity entity, String propertyKey) Deletes the property for a given key and entity<T> TgetProperty(Class<T> clazz, Entity entity, String propertyKey) Retrieves a value object of type T for the given entity and property key.getPropertyKeys(Entity entity) Retrieves a set of all property keys for the given entity.booleansetProperty(Entity entity, String propertyKey, Object value) Sets a new property value (serializing the object to JSON first).
-
Method Details
-
getPropertyKeys
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
Deletes the property for a given key and entityNote: for users, the entity key is the user key (not username)
- Parameters:
entity- The entity for which the property will be deletedpropertyKey- The property to delete
-
setProperty
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 storedpropertyKey- The property key under which the property will be storedvalue- The value object to store as JSON.
-
getProperty
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 retrieveentity- The entity for which the property will be retrievedpropertyKey- The property key to look up.- Returns:
- The deserialized value object
-