-
- All Implemented Interfaces:
-
de.c1710.filemojicompat_ui.interfaces.EmojiPackDownloadListener
public final class DownloadStatus implements EmojiPackDownloadListener
A data structure to collect/store updates from an de.c1710.filemojicompat_ui.pack_helpers.EmojiPackDownloader and pass them on to other listeners
-
-
Constructor Summary
Constructors Constructor Description DownloadStatus()
-
Method Summary
Modifier and Type Method Description final LonggetBytesRead()How many bytes have been downloaded in total final UnitsetBytesRead(Long bytesRead)final LonggetSize()How many bytes the download will have final UnitsetSize(Long size)final IOExceptiongetError()An error that prevented the download from succeeding final UnitsetError(IOException error)final BooleangetDone()Whether the download has finished successfully final UnitsetDone(Boolean done)final BooleangetCancelled()Whether the download has been cancelled final UnitsetCancelled(Boolean cancelled)UnitonProgress(Long bytesRead, Long contentLength)Called throughout the download to update the current download progress. UnitonFailure(IOException e)Called when the download went wrong. UnitonCancelled()Called when the download has been cancelled UnitonDone()Called when the download has been successfully executed. final UnitaddListener(EmojiPackDownloadListener listener)final UnitremoveListener(EmojiPackDownloadListener listener)-
-
Method Detail
-
getBytesRead
final Long getBytesRead()
How many bytes have been downloaded in total
-
setBytesRead
final Unit setBytesRead(Long bytesRead)
-
getError
final IOException getError()
An error that prevented the download from succeeding
-
setError
final Unit setError(IOException error)
-
getCancelled
final Boolean getCancelled()
Whether the download has been cancelled
-
setCancelled
final Unit setCancelled(Boolean cancelled)
-
onProgress
Unit onProgress(Long bytesRead, Long contentLength)
Called throughout the download to update the current download progress.
- Parameters:
bytesRead- How many bytes have already been downloaded (in total).contentLength- How many bytes in total need to be downloaded.
-
onFailure
Unit onFailure(IOException e)
Called when the download went wrong.
-
onCancelled
Unit onCancelled()
Called when the download has been cancelled
-
onDone
Unit onDone()
Called when the download has been successfully executed. Might not be called at all, if the download has been cancelled.
-
addListener
final Unit addListener(EmojiPackDownloadListener listener)
-
removeListener
final Unit removeListener(EmojiPackDownloadListener listener)
-
-
-
-