docs/doc/reference/com/google/android/exoplayer2/testutil/DownloadBuilder.html
Package com.google.android.exoplayer2.testutil
public final classDownloadBuilderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
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.
Constructors | Constructor | Description |
| --- | --- |
| DownloadBuilder(DownloadRequest request) |
Creates a download builder based on the attributes of the specified request.
|
| DownloadBuilder(String id) |
Creates a download builder for "uri" and no stream keys.
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| Download | build() | |
| DownloadBuilder | setBytesDownloaded(long bytesDownloaded) | |
| DownloadBuilder | setCacheKey(String cacheKey) | |
| DownloadBuilder | setContentLength(long contentLength) | |
| DownloadBuilder | setCustomMetadata(byte[] customMetadata) | |
| DownloadBuilder | setFailureReason(int failureReason) | |
| DownloadBuilder | setKeySetId(byte[] keySetId) | |
| DownloadBuilder | setMimeType(String mimeType) | |
| DownloadBuilder | setPercentDownloaded(float percentDownloaded) | |
| DownloadBuilder | setStartTimeMs(long startTimeMs) | |
| DownloadBuilder | setState(@com.google.android.exoplayer2.offline.Download.State int state) | |
| DownloadBuilder | setStopReason(int stopReason) | |
| DownloadBuilder | setStreamKeys(StreamKey... streamKeys) | |
| DownloadBuilder | setUpdateTimeMs(long updateTimeMs) | |
| DownloadBuilder | setUri(Uri uri) | |
| DownloadBuilder | setUri(String uri) | |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public DownloadBuilder([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")id)
Creates a download builder for "uri" and no stream keys.
Parameters:id - The unique content identifier for the download.
-
public DownloadBuilder([DownloadRequest](../offline/DownloadRequest.html "class in com.google.android.exoplayer2.offline")request)
Creates a download builder based on the attributes of the specified request.
Parameters:request - A DownloadRequest defining the content to download.
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setUri([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")uri)
See Also:DownloadRequest.uri
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setUri([Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")uri)
See Also:DownloadRequest.uri
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setMimeType([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")mimeType)
See Also:DownloadRequest.mimeType
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setKeySetId(byte[] keySetId)
See Also:DownloadRequest.keySetId
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setCacheKey(@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")cacheKey)
See Also:DownloadRequest.customCacheKey
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setState([@State](../offline/Download.State.html "annotation in com.google.android.exoplayer2.offline")@com.google.android.exoplayer2.offline.Download.State int state)
See Also:Download.state
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setPercentDownloaded(float percentDownloaded)
See Also:DownloadProgress.percentDownloaded
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setBytesDownloaded(long bytesDownloaded)
See Also:DownloadProgress.bytesDownloaded
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setContentLength(long contentLength)
See Also:Download.contentLength
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setFailureReason(int failureReason)
See Also:Download.failureReason
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setStopReason(int stopReason)
See Also:Download.stopReason
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setStartTimeMs(long startTimeMs)
See Also:Download.startTimeMs
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setUpdateTimeMs(long updateTimeMs)
See Also:Download.updateTimeMs
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setStreamKeys([StreamKey](../offline/StreamKey.html "class in com.google.android.exoplayer2.offline")... streamKeys)
See Also:DownloadRequest.streamKeys
-
@CanIgnoreReturnValue
public[DownloadBuilder](DownloadBuilder.html "class in com.google.android.exoplayer2.testutil")setCustomMetadata(byte[] customMetadata)
See Also:DownloadRequest.data
-
public[Download](../offline/Download.html "class in com.google.android.exoplayer2.offline")build()