Interface IFileListProviding<FileEntity extends IFileEntity<?, FileDataEntity>, FileDataEntity extends IFileDataEntity<FileEntity>>
- Type Parameters:
FileEntity- Type of thefile entity.FileDataEntity- Type of thefile data entity.
- All Superinterfaces:
Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>, de.xima.cmn.dao.interfaces.IEntity<Long>, ITransferable, ITransferableEntity, Serializable
- All Known Implementing Classes:
ClientFormTheme
public interface IFileListProviding<FileEntity extends IFileEntity<?, FileDataEntity>, FileDataEntity extends IFileDataEntity<FileEntity>>
extends ITransferableEntity
Common interface for entities that provide a list of files.
- Since:
- 8.3.0
- Author:
- XIMA Media GmbH
-
Field Summary
Fields inherited from interface de.xima.cmn.dao.interfaces.IEntity
ATTR_IDFields inherited from interface ITransferableEntity
IMPORT_ID, INVALID_ID -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddFile(int index, FileEntity file) Adds the file at the given index to the list of files.default voidaddFile(FileEntity file) Adds the file at the end of the list of files.default FileEntitygetFile(int index) Gets the file at the given index.getFiles()Gets the list of files associated with this entity.default FileEntityremoveFile(int index) Removes a file at the given index.default FileEntitysetFile(int index, FileEntity file) Sets (replaces) the file at the given index to the given file.voidsetFiles(List<FileEntity> fileMap) Sets the list of files associated with this entity.Methods inherited from interface Comparable
compareToMethods inherited from interface de.xima.cmn.dao.interfaces.IEntity
getId, isPersisted, setId
-
Method Details
-
addFile
Adds the file at the given index to the list of files. Negative indices add the file at the beginning, indices greater than the size of the list add the file at the end.- Parameters:
index- The index at which to add the file.file- The file to add to the list of files.
-
addFile
Adds the file at the end of the list of files.- Parameters:
file- The file to add to the list of files.
-
getFile
Gets the file at the given index. Returns null if the index is out of bounds.- Parameters:
index- The index of the file to get.- Returns:
- The file at the given index, or null if the index is out of bounds.
-
getFiles
List<FileEntity> getFiles()Gets the list of files associated with this entity. The list must be mutable.- Returns:
- The list of files associated with this entity.
-
setFiles
Sets the list of files associated with this entity. The list must be mutable.DO NOT USE The collection may be managed by the JPA provider. If replaced with another list, the JPA provider cannot keep track of added and removed files anymore. Instead, prefer using one of the mutator methods, such as
addFile(int, IFileEntity)orremoveFile(int).- Parameters:
fileMap- The list of files to associate with this entity.
-
removeFile
Removes a file at the given index. Does nothing and returns null when the index is out of bounds.- Parameters:
index- The index of the file to remove.- Returns:
- The file that was removed, or
nullif the index was out of bounds.
-
setFile
Sets (replaces) the file at the given index to the given file. No-op when the index is out of bounds.- Parameters:
index- The index at which to set the file.file- The file to add to the list of files.- Returns:
- The file previously stored at the given index, or null if no such file existed.
-