public class MapDelegateVariableContainer extends Object implements VariableContainer
getVariable(String) method first looks if there is a
local transient variable and returns it, if not, the delegate method is called.
In case there is also a variable with the same key here as well as in the delegate,
the delegate is ignored, effectively shadowing the variable of the delegate.| Modifier and Type | Field and Description |
|---|---|
protected VariableContainer |
delegate |
protected Map<String,Object> |
transientVariables |
| Constructor and Description |
|---|
MapDelegateVariableContainer() |
MapDelegateVariableContainer(Map<String,Object> transientVariables,
VariableContainer delegate) |
MapDelegateVariableContainer(VariableContainer delegate) |
| Modifier and Type | Method and Description |
|---|---|
MapDelegateVariableContainer |
addTransientVariable(String key,
Object variable)
Convenience method which returns
this for method concatenation. |
void |
clearTransientVariables()
Clears all transient variables of this variable container (not touching the delegate).
|
String |
getTenantId() |
Map<String,Object> |
getTransientVariables() |
Object |
getVariable(String key)
The method first looks if there is a local transient variable and returns it.
|
boolean |
hasVariable(String key)
Checks whether the given key can be resolved by this variable container.
|
MapDelegateVariableContainer |
removeTransientVariable(String key) |
void |
setTransientVariable(String key,
Object value)
Sets a transient variable, which is local to this variable container.
|
void |
setVariable(String key,
Object value)
Sets the variable to the delegate.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitemptyprotected final VariableContainer delegate
public MapDelegateVariableContainer(Map<String,Object> transientVariables, VariableContainer delegate)
public MapDelegateVariableContainer(VariableContainer delegate)
public MapDelegateVariableContainer()
public boolean hasVariable(String key)
hasVariable in interface VariableContainerkey - the name of the variablegetVariable(String)public Object getVariable(String key)
getVariable in interface VariableContainerpublic void setVariable(String key, Object value)
VariableContainer.empty()
it is set as transient variable for this container to ensure consistent
behavior, when using this variable container without a delegate.
Use addTransientVariable(String, Object) to add
variables local to this variable container only.setVariable in interface VariableContainerkey - the variable namevalue - the variable value to set to the delegatepublic void setTransientVariable(String key, Object value)
setTransientVariable in interface VariableContainerkey - the variable namevalue - the variable valueaddTransientVariable(String, Object)public MapDelegateVariableContainer addTransientVariable(String key, Object variable)
this for method concatenation.
Same as setTransientVariable(String, Object)public void clearTransientVariables()
public Map<String,Object> getTransientVariables()
public MapDelegateVariableContainer removeTransientVariable(String key)
public String getTenantId()
getTenantId in interface VariableContainerCopyright © 2022 Flowable. All rights reserved.