- java.lang.Object
-
- com.github.mizosoft.methanol.ProgressTracker.Builder
-
- Enclosing class:
- ProgressTracker
public static final class ProgressTracker.Builder extends java.lang.ObjectA builder ofProgressTrackers.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProgressTrackerbuild()Builds a newProgressTracker.ProgressTracker.BuilderbytesTransferredThreshold(long value)Sets the minimum number of transferred bytes for a progress event to be signalled.ProgressTracker.BuilderenclosedProgress(boolean enclosedProgress)If set totrue(default), the sequence of progress events will be enclosed between0%and100%progresses to detect begin and completion events respectively.ProgressTracker.Builderexecutor(java.util.concurrent.Executor executor)Sets the executor on whichProgressTracker.Listenermethods are called.ProgressTracker.BuildertimePassedThreshold(java.time.Duration duration)Sets the minimum amount of time to pass for a progress event to be signalled.
-
-
-
Method Detail
-
bytesTransferredThreshold
@CanIgnoreReturnValue public ProgressTracker.Builder bytesTransferredThreshold(long value)
Sets the minimum number of transferred bytes for a progress event to be signalled. The default value is zero.- Throws:
java.lang.IllegalArgumentException- if value is negative
-
timePassedThreshold
@CanIgnoreReturnValue public ProgressTracker.Builder timePassedThreshold(java.time.Duration duration)
Sets the minimum amount of time to pass for a progress event to be signalled.- Throws:
java.lang.IllegalArgumentException- if duration is not positive
-
enclosedProgress
@CanIgnoreReturnValue public ProgressTracker.Builder enclosedProgress(boolean enclosedProgress)
If set totrue(default), the sequence of progress events will be enclosed between0%and100%progresses to detect begin and completion events respectively.
-
executor
@CanIgnoreReturnValue public ProgressTracker.Builder executor(java.util.concurrent.Executor executor)
Sets the executor on whichProgressTracker.Listenermethods are called. If not set, the listener will be signalled inline with body receiver.
-
build
public ProgressTracker build()
Builds a newProgressTracker.
-
-