Interface DownloadRequest.UntypedBuilder
-
- Enclosing class:
- DownloadRequest<ReturnT>
public static interface DownloadRequest.UntypedBuilderInitial calls toDownloadRequest.builder()return anDownloadRequest.UntypedBuilder, where the builder is not yet parameterized with the generic type associated withDownloadRequest. This prevents the otherwise awkward syntax of having to explicitly cast the builder type, e.g.,
Instead, the type may be inferred as part of specifying theDownloadRequest.<ResponseBytes<GetObjectResponse>>builder()responseTransformer(AsyncResponseTransformer)parameter, at which point the builder chain will return a newDownloadRequest.TypedBuilder.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DownloadRequest.UntypedBuilderaddTransferListener(TransferListener transferListener)Adds aTransferListenerthat will be notified as part of this request.default DownloadRequest.UntypedBuildergetObjectRequest(Consumer<GetObjectRequest.Builder> getObjectRequestBuilder)TheGetObjectRequestrequest that should be used for the downloadDownloadRequest.UntypedBuildergetObjectRequest(GetObjectRequest getObjectRequest)TheGetObjectRequestrequest that should be used for the download<T> DownloadRequest.TypedBuilder<T>responseTransformer(AsyncResponseTransformer<GetObjectResponse,T> responseTransformer)Specifies theAsyncResponseTransformerthat should be used for the download.DownloadRequest.UntypedBuildertransferListeners(Collection<TransferListener> transferListeners)TheTransferListeners that will be notified as part of this request.
-
-
-
Method Detail
-
getObjectRequest
DownloadRequest.UntypedBuilder getObjectRequest(GetObjectRequest getObjectRequest)
TheGetObjectRequestrequest 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(Consumer)
-
getObjectRequest
default DownloadRequest.UntypedBuilder getObjectRequest(Consumer<GetObjectRequest.Builder> getObjectRequestBuilder)
TheGetObjectRequestrequest that should be used for the downloadThis is a convenience method that creates an instance of the
GetObjectRequestbuilder, 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:
getObjectRequest(GetObjectRequest)
-
transferListeners
DownloadRequest.UntypedBuilder transferListeners(Collection<TransferListener> transferListeners)
TheTransferListeners 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:
TransferListener
-
addTransferListener
DownloadRequest.UntypedBuilder addTransferListener(TransferListener transferListener)
Adds aTransferListenerthat 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:
TransferListener
-
responseTransformer
<T> DownloadRequest.TypedBuilder<T> responseTransformer(AsyncResponseTransformer<GetObjectResponse,T> responseTransformer)
Specifies theAsyncResponseTransformerthat should be used for the download. This method also infers the generic type ofDownloadRequestto create, inferred from the second type parameter of the providedAsyncResponseTransformer. E.g, specifyingAsyncResponseTransformer.toBytes()would result in inferring the type of theDownloadRequestto be ofResponseBytes<GetObjectResponse>. See the static factory methods available inAsyncResponseTransformer.- Type Parameters:
T- the type ofDownloadRequestto create- Parameters:
responseTransformer- the AsyncResponseTransformer- Returns:
- a reference to this object so that method calls can be chained together.
- See Also:
AsyncResponseTransformer
-
-