Class DefaultTransferProgressSnapshot
java.lang.Object
software.amazon.awssdk.transfer.s3.internal.progress.DefaultTransferProgressSnapshot
- All Implemented Interfaces:
TransferProgressSnapshot
,ToCopyableBuilder<DefaultTransferProgressSnapshot.Builder,
DefaultTransferProgressSnapshot>
public final class DefaultTransferProgressSnapshot
extends Object
implements ToCopyableBuilder<DefaultTransferProgressSnapshot.Builder,DefaultTransferProgressSnapshot>, TransferProgressSnapshot
An SDK-internal implementation of
TransferProgressSnapshot
.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
boolean
int
hashCode()
The ratio of theTransferProgressSnapshot.totalBytes()
that has been transferred so far, orOptional.empty()
if unknown.The total number of bytes that are remaining to be transferred, orOptional.empty()
if unknown.The SDK response, orOptional.empty()
if unknown.Take this object and create a builder that contains all of the current property values of this object.toString()
The total size of the transfer, in bytes, orOptional.empty()
if unknown.long
The total number of bytes that have been transferred so far.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
builder
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<DefaultTransferProgressSnapshot.Builder,
DefaultTransferProgressSnapshot> - Returns:
- a builder for type T
-
transferredBytes
public long transferredBytes()Description copied from interface:TransferProgressSnapshot
The total number of bytes that have been transferred so far.- Specified by:
transferredBytes
in interfaceTransferProgressSnapshot
-
totalBytes
Description copied from interface:TransferProgressSnapshot
The total size of the transfer, in bytes, orOptional.empty()
if unknown.In the case of file-based
FileUpload
s, transfer sizes are known up front and immediately available. In the case ofDownload
s, the transfer size is not known untilS3TransferManager
receives aGetObjectResponse
from Amazon S3.- Specified by:
totalBytes
in interfaceTransferProgressSnapshot
-
sdkResponse
Description copied from interface:TransferProgressSnapshot
The SDK response, orOptional.empty()
if unknown.In the case of
Download
, the response isGetObjectResponse
, and the response is known before it starts streaming. In the case ofUpload
, the response isPutObjectResponse
, and the response is not known until streaming finishes.- Specified by:
sdkResponse
in interfaceTransferProgressSnapshot
-
ratioTransferred
Description copied from interface:TransferProgressSnapshot
The ratio of theTransferProgressSnapshot.totalBytes()
that has been transferred so far, orOptional.empty()
if unknown. This method depends on theTransferProgressSnapshot.totalBytes()
being known in order to return non-empty.Ratio is computed as
TransferProgressSnapshot.transferredBytes()
/
TransferProgressSnapshot.totalBytes()
, where a transfer that is half-complete would return0.5
.- Specified by:
ratioTransferred
in interfaceTransferProgressSnapshot
- See Also:
-
equals
-
hashCode
-
remainingBytes
Description copied from interface:TransferProgressSnapshot
The total number of bytes that are remaining to be transferred, orOptional.empty()
if unknown. This method depends on theTransferProgressSnapshot.totalBytes()
being known in order to return non-empty.- Specified by:
remainingBytes
in interfaceTransferProgressSnapshot
- See Also:
-
toString
-