DownloadBuilder
@UnstableApi
public final class DownloadBuilder
Builder for Download.
Defines default values for each field (except id) to facilitate Download creation for tests. Tests must avoid depending on the default values but explicitly set tested parameters during test initialization.
Summary
Public constructors |
|---|
|
Creates a download builder for "uri" and no stream keys. |
DownloadBuilder(DownloadRequest request)Creates a download builder based on the attributes of the specified request. |
Public constructors
DownloadBuilder
public DownloadBuilder(String id)
Creates a download builder for "uri" and no stream keys.
| Parameters | |
|---|---|
String id |
The unique content identifier for the download. |
DownloadBuilder
public DownloadBuilder(DownloadRequest request)
Creates a download builder based on the attributes of the specified request.
| Parameters | |
|---|---|
DownloadRequest request |
A |
Public methods
setBytesDownloaded
@CanIgnoreReturnValue
public DownloadBuilder setBytesDownloaded(long bytesDownloaded)
| See also | |
|---|---|
bytesDownloaded |
setCacheKey
@CanIgnoreReturnValue
public DownloadBuilder setCacheKey(@Nullable String cacheKey)
| See also | |
|---|---|
customCacheKey |
setContentLength
@CanIgnoreReturnValue
public DownloadBuilder setContentLength(long contentLength)
| See also | |
|---|---|
contentLength |
setCustomMetadata
@CanIgnoreReturnValue
public DownloadBuilder setCustomMetadata(byte[] customMetadata)
| See also | |
|---|---|
data |
setFailureReason
@CanIgnoreReturnValue
public DownloadBuilder setFailureReason(int failureReason)
| See also | |
|---|---|
failureReason |
setKeySetId
@CanIgnoreReturnValue
public DownloadBuilder setKeySetId(byte[] keySetId)
| See also | |
|---|---|
keySetId |
setMimeType
@CanIgnoreReturnValue
public DownloadBuilder setMimeType(String mimeType)
| See also | |
|---|---|
mimeType |
setPercentDownloaded
@CanIgnoreReturnValue
public DownloadBuilder setPercentDownloaded(float percentDownloaded)
| See also | |
|---|---|
percentDownloaded |
setStartTimeMs
@CanIgnoreReturnValue
public DownloadBuilder setStartTimeMs(long startTimeMs)
| See also | |
|---|---|
startTimeMs |
setState
@CanIgnoreReturnValue
public DownloadBuilder setState(@Download.State int state)
| See also | |
|---|---|
state |
setStopReason
@CanIgnoreReturnValue
public DownloadBuilder setStopReason(int stopReason)
| See also | |
|---|---|
stopReason |
setStreamKeys
@CanIgnoreReturnValue
public DownloadBuilder setStreamKeys(StreamKey[] streamKeys)
| See also | |
|---|---|
streamKeys |
setUpdateTimeMs
@CanIgnoreReturnValue
public DownloadBuilder setUpdateTimeMs(long updateTimeMs)
| See also | |
|---|---|
updateTimeMs |