Interface DataObjectModificationBuilder
-
- All Known Implementing Classes:
DataObjectModificationBuilderImpl
,GenericDataObjectModificationBuilder
public interface DataObjectModificationBuilder
The basic data object modification builder which might be extended with a strongly typed support by the underlyingDataObjectDataSource
implementation.- Author:
- Micha Kiener
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default DataObjectModificationBuilder
accessibleByUser(String userId)
DataObjectModificationBuilder
accessibleByUserOrGroups(String userId, Collection<String> groupKeys)
DataObjectModificationBuilder
definitionId(String id)
Set the id of the data object definition the update operation should be based on.DataObjectModificationBuilder
definitionKey(String key)
Set the key of the data object definition the update operation should be based on.String
getDefinitionId()
Returns the id of the data object definition this modification builder is based on.Map<String,Object>
getModificationData()
Map<String,Object>
getOriginalData()
DataObjectModificationBuilder
lookupId(String lookupId)
The id of the data object that should be modified with the data.DataObjectInstanceVariableContainer
modify()
Persists the modified data object instance.DataObjectModificationBuilder
modifyFromPayload(DataObjectHandlingContext context)
If a modification builder is used to modify a data object given by the payload sent from a form typically, this method is invoked to modify the data object according the given payload data.DataObjectModificationBuilder
operation(String operation)
Set the key of the operation that should be used to create the object.DataObjectModificationBuilder
originalValue(String valueName, Object value)
Generic setter for a data object field value specified by its name and value to be set.DataObjectModificationBuilder
tenantId(String tenantId)
Set the tenant id for data object definition.DataObjectModificationBuilder
value(String valueName, Object value)
Generic setter for a data object field value specified by its name and value to be set.
-
-
-
Method Detail
-
getDefinitionId
String getDefinitionId()
Returns the id of the data object definition this modification builder is based on.- Returns:
- the id of the data object definition
-
definitionId
DataObjectModificationBuilder definitionId(String id)
Set the id of the data object definition the update operation should be based on. Must only be provided, if the data object definition key is not set.
-
definitionKey
DataObjectModificationBuilder definitionKey(String key)
Set the key of the data object definition the update operation should be based on. If set, the latest definition id is used. The key is ignored, if the definition id is set directly.
-
tenantId
DataObjectModificationBuilder tenantId(String tenantId)
Set the tenant id for data object definition. This can be used together with the definition key for the lookup
-
operation
DataObjectModificationBuilder operation(String operation)
Set the key of the operation that should be used to create the object.
-
lookupId
DataObjectModificationBuilder lookupId(String lookupId)
The id of the data object that should be modified with the data. Only relevant when using the default update operation.
-
modifyFromPayload
DataObjectModificationBuilder modifyFromPayload(DataObjectHandlingContext context)
If a modification builder is used to modify a data object given by the payload sent from a form typically, this method is invoked to modify the data object according the given payload data.- Parameters:
context
- the data object context containing the data and full payload and further information for parsing the content into the data object- Returns:
- the builder instance for method chaining
-
value
DataObjectModificationBuilder value(String valueName, Object value)
Generic setter for a data object field value specified by its name and value to be set.- Parameters:
valueName
- the name of the data object field to set a valuevalue
- the value to be set- Returns:
- the builder instance for method chaining
-
originalValue
DataObjectModificationBuilder originalValue(String valueName, Object value)
Generic setter for a data object field value specified by its name and value to be set.- Parameters:
valueName
- the name of the data object field to set a valuevalue
- the value to be set- Returns:
- the builder instance for method chaining
-
accessibleByUser
default DataObjectModificationBuilder accessibleByUser(String userId)
-
accessibleByUserOrGroups
DataObjectModificationBuilder accessibleByUserOrGroups(String userId, Collection<String> groupKeys)
-
modify
DataObjectInstanceVariableContainer modify()
Persists the modified data object instance. This operation will try to return the container that was modified. NOTE: Whether something is returned or not depends on the implementation for the operation- Returns:
- the modified data object instance which might be the very same or actually a new one returned by the data source
-
-