Class DownloadBuilder
- java.lang.Object
-
- com.google.android.exoplayer2.testutil.DownloadBuilder
-
public final class DownloadBuilder extends Object
-
-
Constructor Summary
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.
-
Method Summary
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(int state)
DownloadBuilder
setStopReason(int stopReason)
DownloadBuilder
setStreamKeys(StreamKey... streamKeys)
DownloadBuilder
setUpdateTimeMs(long updateTimeMs)
DownloadBuilder
setUri(Uri uri)
DownloadBuilder
setUri(String uri)
-
-
-
Constructor Detail
-
DownloadBuilder
public DownloadBuilder(String id)
Creates a download builder for "uri" and no stream keys.- Parameters:
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:
request
- ADownloadRequest
defining the content to download.
-
-
Method Detail
-
setUri
public DownloadBuilder setUri(String uri)
- See Also:
DownloadRequest.uri
-
setUri
public DownloadBuilder setUri(Uri uri)
- See Also:
DownloadRequest.uri
-
setMimeType
public DownloadBuilder setMimeType(String mimeType)
- See Also:
DownloadRequest.mimeType
-
setKeySetId
public DownloadBuilder setKeySetId(byte[] keySetId)
- See Also:
DownloadRequest.keySetId
-
setCacheKey
public DownloadBuilder setCacheKey(@Nullable String cacheKey)
- See Also:
DownloadRequest.customCacheKey
-
setState
public DownloadBuilder setState(@State int state)
- See Also:
Download.state
-
setPercentDownloaded
public DownloadBuilder setPercentDownloaded(float percentDownloaded)
- See Also:
DownloadProgress.percentDownloaded
-
setBytesDownloaded
public DownloadBuilder setBytesDownloaded(long bytesDownloaded)
- See Also:
DownloadProgress.bytesDownloaded
-
setContentLength
public DownloadBuilder setContentLength(long contentLength)
- See Also:
Download.contentLength
-
setFailureReason
public DownloadBuilder setFailureReason(int failureReason)
- See Also:
Download.failureReason
-
setStopReason
public DownloadBuilder setStopReason(int stopReason)
- See Also:
Download.stopReason
-
setStartTimeMs
public DownloadBuilder setStartTimeMs(long startTimeMs)
- See Also:
Download.startTimeMs
-
setUpdateTimeMs
public DownloadBuilder setUpdateTimeMs(long updateTimeMs)
- See Also:
Download.updateTimeMs
-
setStreamKeys
public DownloadBuilder setStreamKeys(StreamKey... streamKeys)
- See Also:
DownloadRequest.streamKeys
-
setCustomMetadata
public DownloadBuilder setCustomMetadata(byte[] customMetadata)
- See Also:
DownloadRequest.data
-
build
public Download build()
-
-