@Mutable @ThreadSafe public final class DefaultTransferProgress extends Object implements TransferProgress
TransferProgress. This implementation acts as a thin wrapper around AtomicReference, where calls to get the latest snapshot() simply return the latest reference, while TransferProgressUpdater is responsible for continuously updating the latest reference.TransferProgress| Constructor and Description |
|---|
DefaultTransferProgress(TransferProgressSnapshot snapshot) |
| Modifier and Type | Method and Description |
|---|---|
TransferProgressSnapshot |
snapshot()
Takes a snapshot of the current progress, represented by an immutable
TransferProgressSnapshot. |
String |
toString() |
TransferProgressSnapshot |
updateAndGet(Consumer<DefaultTransferProgressSnapshot.Builder> updater)
Atomically convert the current snapshot reference to its
DefaultTransferProgressSnapshot.Builder, perform updates using the provided Consumer, and save the result as the latest snapshot. |
public DefaultTransferProgress(TransferProgressSnapshot snapshot)
public TransferProgressSnapshot updateAndGet(Consumer<DefaultTransferProgressSnapshot.Builder> updater)
DefaultTransferProgressSnapshot.Builder, perform updates using the provided Consumer, and save the result as the latest snapshot.public TransferProgressSnapshot snapshot()
TransferProgressTransferProgressSnapshot.snapshot in interface TransferProgressCopyright © 2023. All rights reserved.