Interface IFileListProviding<FileEntity extends IFileEntity<?,​FileDataEntity>,​FileDataEntity extends IFileDataEntity<FileEntity>>

    • 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) or removeFile(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.