Interface DownloadRequest.UntypedBuilder
- Enclosing class:
DownloadRequest<ReturnT>
public static interface DownloadRequest.UntypedBuilder
Initial calls to
DownloadRequest.builder()
return an DownloadRequest.UntypedBuilder
, where the builder is not yet
parameterized with the generic type associated with DownloadRequest
. This prevents the otherwise awkward syntax of
having to explicitly cast the builder type, e.g.,
DownloadRequest.<ResponseBytes<GetObjectResponse>>builder()
Instead, the type may be inferred as part of specifying the responseTransformer(AsyncResponseTransformer)
parameter, at which point the builder chain will return a new DownloadRequest.TypedBuilder
.-
Method Summary
Modifier and TypeMethodDescriptionaddTransferListener
(TransferListener transferListener) Adds aTransferListener
that will be notified as part of this request.default DownloadRequest.UntypedBuilder
getObjectRequest
(Consumer<GetObjectRequest.Builder> getObjectRequestBuilder) TheGetObjectRequest
request that should be used for the downloadgetObjectRequest
(GetObjectRequest getObjectRequest) TheGetObjectRequest
request that should be used for the download<T> DownloadRequest.TypedBuilder
<T> responseTransformer
(AsyncResponseTransformer<GetObjectResponse, T> responseTransformer) Specifies theAsyncResponseTransformer
that should be used for the download.transferListeners
(Collection<TransferListener> transferListeners) TheTransferListener
s that will be notified as part of this request.
-
Method Details
-
getObjectRequest
TheGetObjectRequest
request that should be used for the download- Parameters:
getObjectRequest
- the getObject request- Returns:
- a reference to this object so that method calls can be chained together.
- See Also:
-
getObjectRequest
default DownloadRequest.UntypedBuilder getObjectRequest(Consumer<GetObjectRequest.Builder> getObjectRequestBuilder) TheGetObjectRequest
request that should be used for the downloadThis is a convenience method that creates an instance of the
GetObjectRequest
builder, avoiding the need to create one manually viaGetObjectRequest.builder()
.- Parameters:
getObjectRequestBuilder
- the getObject request- Returns:
- a reference to this object so that method calls can be chained together.
- See Also:
-
transferListeners
TheTransferListener
s that will be notified as part of this request. This method overrides and replaces any transferListeners that have already been set. Add an optional request override configuration.- Parameters:
transferListeners
- the collection of transferListeners- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
addTransferListener
Adds aTransferListener
that will be notified as part of this request.- Parameters:
transferListener
- the transferListener to add- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
responseTransformer
<T> DownloadRequest.TypedBuilder<T> responseTransformer(AsyncResponseTransformer<GetObjectResponse, T> responseTransformer) Specifies theAsyncResponseTransformer
that should be used for the download. This method also infers the generic type ofDownloadRequest
to create, inferred from the second type parameter of the providedAsyncResponseTransformer
. E.g, specifyingAsyncResponseTransformer.toBytes()
would result in inferring the type of theDownloadRequest
to be ofResponseBytes<GetObjectResponse>
. See the static factory methods available inAsyncResponseTransformer
.- Type Parameters:
T
- the type ofDownloadRequest
to create- Parameters:
responseTransformer
- the AsyncResponseTransformer- Returns:
- a reference to this object so that method calls can be chained together.
- See Also:
-