Package de.xima.fc.common.transfer
Interface IEntityExportNameProvider<Entity>
-
- Type Parameters:
Entity
- The type of the entity.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface IEntityExportNameProvider<Entity>
SeeEntityTransferDetails
. Should only be used on types that implementIFileEntity
.When exporting a set of entities to a ZIP archive, for each
IFileEntity
, a file with the binary data of the file entity needs to be created. This interface provides custom logic for the name of that file. By default, the UUID is used if the file entity implementsIUUIDEntity
, otherwise itsfile name
.- Since:
- 8.3.0
- Author:
- XIMA Media GmbH
- See Also:
EntityTransferDetails
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
createFileName(Entity fileEntity, de.xima.cmn.dao.interfaces.IEntity<?> baseEntity)
Creates the file name to use for the given file entity.default boolean
isMatchesFileName(Entity entity, de.xima.cmn.dao.interfaces.IEntity<?> baseEntity, String fileName)
Tests whether the given file name matches the file name of the given file entity.
-
-
-
Method Detail
-
createFileName
String createFileName(Entity fileEntity, de.xima.cmn.dao.interfaces.IEntity<?> baseEntity)
Creates the file name to use for the given file entity.- Parameters:
fileEntity
- The file entity.baseEntity
- Optional base entity containing the file entity. May be null when not available.- Returns:
- The file name.
-
isMatchesFileName
default boolean isMatchesFileName(Entity entity, de.xima.cmn.dao.interfaces.IEntity<?> baseEntity, String fileName)
Tests whether the given file name matches the file name of the given file entity. By default, this simply checks whether the file name fromcreateFileName
equals the given file name.- Parameters:
entity
- The entity.baseEntity
- Optional base entity containing the file entity. May be null when not available.fileName
- The file name to test.- Returns:
- Whether the file name matches the file entity.
-
-