Module methanol

Class ProgressTracker.Builder

  • Enclosing class:
    ProgressTracker

    public static final class ProgressTracker.Builder
    extends java.lang.Object
    A builder of ProgressTrackers.
    • 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 to true (default), the sequence of progress events will be enclosed between 0% and 100% progresses to detect begin and completion events respectively.
      • executor

        @CanIgnoreReturnValue
        public ProgressTracker.Builder executor​(java.util.concurrent.Executor executor)
        Sets the executor on which ProgressTracker.Listener methods are called. If not set, the listener will be signalled inline with body receiver.