Class DetachedDataObjectInstanceVariableContainer
- java.lang.Object
-
- com.flowable.dataobject.engine.impl.runtime.DetachedDataObjectInstanceVariableContainer
-
- All Implemented Interfaces:
DataObjectInstanceVariableContainer
,VariableContainer
public class DetachedDataObjectInstanceVariableContainer extends Object implements DataObjectInstanceVariableContainer
- Author:
- Filip Hrisafov
-
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.databind.node.ObjectNode
data
protected String
definitionId
protected String
definitionKey
protected Map<String,String>
fieldNamesToType
protected String
lookupId
protected String
tenantId
-
Constructor Summary
Constructors Constructor Description DetachedDataObjectInstanceVariableContainer(com.fasterxml.jackson.databind.node.ObjectNode data, String lookupId, String tenantId, DataObjectDefinition dataObjectDefinition, ServiceRegistryDataObjectModel objectModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.node.ObjectNode
getData()
String
getDefinitionId()
Returns the id of the master data definition this instance belongs to.String
getDefinitionKey()
Returns the key of the master data definition this instance belongs to.Object
getId()
Object
getLookupId()
Returns the lookup id of this data object instance, which needs to be unique only within the same data object definition and source.String
getTenantId()
The tenant id of the definition<T> T
getValue(String property, Class<T> valueType)
Get a value for the givenproperty
with the givevalueType
boolean
hasValue(String property)
Check whether the data object instance has the given propertyprotected <T> T
nodeToValue(String property, com.fasterxml.jackson.databind.JsonNode valueNode, Class<T> valueType)
Iterable<String>
propertyNames()
An iterable of all the names of the properties for this data object instance.<T> T
removeValue(String property, Class<T> propertyClass)
void
setId(Object id)
void
setTransientVariable(String variableName, Object variableValue)
<T> void
setValue(String property, T value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.flowable.dataobject.api.runtime.DataObjectInstanceVariableContainer
getBoolean, getDate, getDouble, getInteger, getLocalDate, getLong, getString, getVariable, hasVariable, removeValue, setVariable
-
-
-
-
Constructor Detail
-
DetachedDataObjectInstanceVariableContainer
public DetachedDataObjectInstanceVariableContainer(com.fasterxml.jackson.databind.node.ObjectNode data, String lookupId, String tenantId, DataObjectDefinition dataObjectDefinition, ServiceRegistryDataObjectModel objectModel)
-
-
Method Detail
-
getId
public Object getId()
- Specified by:
getId
in interfaceDataObjectInstanceVariableContainer
-
setId
public void setId(Object id)
- Specified by:
setId
in interfaceDataObjectInstanceVariableContainer
-
getLookupId
public Object getLookupId()
Description copied from interface:DataObjectInstanceVariableContainer
Returns the lookup id of this data object instance, which needs to be unique only within the same data object definition and source.- Specified by:
getLookupId
in interfaceDataObjectInstanceVariableContainer
- Returns:
- the lookup id of this data object, as given and used by the data source managing this data object instance
-
getDefinitionId
public String getDefinitionId()
Description copied from interface:DataObjectInstanceVariableContainer
Returns the id of the master data definition this instance belongs to.- Specified by:
getDefinitionId
in interfaceDataObjectInstanceVariableContainer
- Returns:
- the id of the master data definition
-
getDefinitionKey
public String getDefinitionKey()
Description copied from interface:DataObjectInstanceVariableContainer
Returns the key of the master data definition this instance belongs to.- Specified by:
getDefinitionKey
in interfaceDataObjectInstanceVariableContainer
- Returns:
- the key of the master data definition
-
getValue
public <T> T getValue(String property, Class<T> valueType)
Description copied from interface:DataObjectInstanceVariableContainer
Get a value for the givenproperty
with the givevalueType
- Specified by:
getValue
in interfaceDataObjectInstanceVariableContainer
- Type Parameters:
T
- the type of the value- Parameters:
property
- the name of the propertyvalueType
- the type of the value- Returns:
- the value for the given property
-
nodeToValue
protected <T> T nodeToValue(String property, com.fasterxml.jackson.databind.JsonNode valueNode, Class<T> valueType)
-
hasValue
public boolean hasValue(String property)
Description copied from interface:DataObjectInstanceVariableContainer
Check whether the data object instance has the given property- Specified by:
hasValue
in interfaceDataObjectInstanceVariableContainer
- Parameters:
property
- the name of the property- Returns:
true
if this data object instance has a property with given name,false
otherwise
-
setValue
public <T> void setValue(String property, T value)
- Specified by:
setValue
in interfaceDataObjectInstanceVariableContainer
-
removeValue
public <T> T removeValue(String property, Class<T> propertyClass)
- Specified by:
removeValue
in interfaceDataObjectInstanceVariableContainer
-
setTransientVariable
public void setTransientVariable(String variableName, Object variableValue)
- Specified by:
setTransientVariable
in interfaceVariableContainer
-
getTenantId
public String getTenantId()
Description copied from interface:DataObjectInstanceVariableContainer
The tenant id of the definition- Specified by:
getTenantId
in interfaceDataObjectInstanceVariableContainer
- Specified by:
getTenantId
in interfaceVariableContainer
- Returns:
- the tenant id of the definition
-
propertyNames
public Iterable<String> propertyNames()
Description copied from interface:DataObjectInstanceVariableContainer
An iterable of all the names of the properties for this data object instance.- Specified by:
propertyNames
in interfaceDataObjectInstanceVariableContainer
- Returns:
- iterator of the properties
-
getData
public com.fasterxml.jackson.databind.node.ObjectNode getData()
- Specified by:
getData
in interfaceDataObjectInstanceVariableContainer
-
-