Interface IWorkflowBpmnDataStore
-
public interface IWorkflowBpmnDataStore
The data store that provides access to custom data associated with the current BPMN model context. Can be used, for example, as a generic way to cache data temporarily during the BPMN model creation process. All data will be discarded after the BPMN model was created.- Since:
- 8.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <K,V>
Vcompute(K key, Class<V> valueType, BiFunction<? super K,? super V,? extends V> updater)
Computes a value for the given key using the provided updater function.<K,V>
VcomputeIfAbsent(K key, Class<V> valueType, Function<? super K,? extends V> initializer)
Computes a value for the given key if no value is currently associated with it, using the provided initializer function.Iterable<Map.Entry<Object,Object>>
entries()
Returns an iterable over all entries in the data store.Object
get(Object key)
Gets the value associated with the given key.<T> T
get(Object key, Class<T> type)
Gets the value associated with the given key, cast to the specified type.void
remove(Object key)
Removes the value associated with the given key (if any).void
set(Object key, Object value)
Associates the given value with the given key.
-
-
-
Method Detail
-
compute
<K,V> V compute(K key, Class<V> valueType, BiFunction<? super K,? super V,? extends V> updater)
Computes a value for the given key using the provided updater function. If a value is already associated with the key, the updater function is called with the key and the current value, and the result is stored as the new value. If no value is currently associated with the key, the updater function gets called with the key and a null value.- Type Parameters:
K
- The type of the key.V
- The type of the value.- Parameters:
key
- The key to look up.valueType
- The type of the value.updater
- The function to compute the new value.- Returns:
- The new or updated value associated with the key.
-
computeIfAbsent
<K,V> V computeIfAbsent(K key, Class<V> valueType, Function<? super K,? extends V> initializer)
Computes a value for the given key if no value is currently associated with it, using the provided initializer function.- Type Parameters:
K
- The type of the keyV
- The type of the value- Parameters:
key
- The key to look upvalueType
- The type of the value to be computed.initializer
- The function to compute the value if no value is currently associated with the key- Returns:
- The value associated with the key, either the existing value or the newly computed value
-
entries
Iterable<Map.Entry<Object,Object>> entries()
Returns an iterable over all entries in the data store.- Returns:
- An iterable over all entries in the data store.
-
get
<T> T get(Object key, Class<T> type)
Gets the value associated with the given key, cast to the specified type.- Type Parameters:
T
- The type to cast the value to- Parameters:
key
- The key to look uptype
- The type to cast the value to- Returns:
- The value associated with the key, cast to the specified type, or null if no value is associated with the key or if the value is not of the specified type.
-
get
Object get(Object key)
Gets the value associated with the given key.- Parameters:
key
- The key to look up- Returns:
- The value associated with the key, or null if no value is associated with the key.
-
remove
void remove(Object key)
Removes the value associated with the given key (if any).- Parameters:
key
- The key to remove the value for.
-
set
void set(Object key, Object value)
Associates the given value with the given key.- Parameters:
key
- The key to associate the value withvalue
- The value to associate with the key. If null, behaves likeremove(Object)
.
-
-