Package org.activiti.cloud.modeling.api
Interface ModelContentConverter<T extends ModelContent>
public interface ModelContentConverter<T extends ModelContent>
Model content converter interface
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]convertToBytes(T modelContent) Convert an instance of the model content to bytes arrayconvertToModelContent(byte[] bytes) Convert a bytes array to the handled model content entity.Get handled model type by this converter.default FileContentoverrideModelId(FileContent fileContent, Map<String, String> modelIdentifiers) Converts the file content to the handled model content entity, sets the given id, and converts back to a FileContent.
-
Method Details
-
getHandledModelType
ModelType getHandledModelType()Get handled model type by this converter.- Returns:
- handled model type
-
convertToModelContent
Convert a bytes array to the handled model content entity.- Parameters:
bytes- the bytes to convert- Returns:
- the model content, or
Optional.empty()
-
convertToBytes
Convert an instance of the model content to bytes array- Parameters:
modelContent- the model content instance to convert- Returns:
- the bytes array
-
overrideModelId
Converts the file content to the handled model content entity, sets the given id, and converts back to a FileContent. If the id is already the expected one, it returns it unchanged.- Parameters:
fileContent- the FileContent wrapper to convert and fixmodelIdentifiers- the mapping of the old ids to the new ones- Returns:
- the fixed FileContent
-