Package de.xima.fc.entities.interfaces
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.fc.entities.interfaces.ITransferableEntity
IMPORT_ID, INVALID_ID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
addFile(int index, FileEntity file)
Adds the file at the given index to the list of files.default void
addFile(FileEntity file)
Adds the file at the end of the list of files.default FileEntity
getFile(int index)
Gets the file at the given index.List<FileEntity>
getFiles()
Gets the list of files associated with this entity.default FileEntity
removeFile(int index)
Removes a file at the given index.default FileEntity
setFile(int index, FileEntity file)
Sets (replaces) the file at the given index to the given file.void
setFiles(List<FileEntity> fileMap)
Sets the list of files associated with this entity.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
addFile
default void addFile(int index, FileEntity file)
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
default void addFile(FileEntity file)
Adds the file at the end of the list of files.- Parameters:
file
- The file to add to the list of files.
-
getFile
default FileEntity getFile(int index)
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
void setFiles(List<FileEntity> fileMap)
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
default FileEntity removeFile(int index)
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
null
if the index was out of bounds.
-
setFile
default FileEntity setFile(int index, FileEntity file)
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.
-
-