Package com.complexible.common.base
Class ProgressMonitor.Builder
- java.lang.Object
-
- com.complexible.common.base.ProgressMonitor.Builder
-
- Enclosing class:
- ProgressMonitor
public static class ProgressMonitor.Builder extends java.lang.Object
Builder class for a customizable progress monitor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProgressMonitor
build()
Returns a new monitor instance with specified options.ProgressMonitor.Builder
maxProgress(long maxProgress)
Sets the maximum progress value for the monitor and returns this builder instance.ProgressMonitor.Builder
messageFormatter(ProgressMonitor.ProgressFormatter formatter)
ProgressMonitor.Builder
output(java.io.OutputStream output)
Sets the output stream for the monitor and returns this builder instance.ProgressMonitor.Builder
reportingDelegate(java.util.Optional<ProgressReporter> reporter)
Set a reporter which will also see progress reportingProgressMonitor.Builder
reportIntervalPercent(int reportIntervalPercent)
Sets the reporting interval (as the number of percent increment) for the monitor and returns this builder instance.
-
-
-
Method Detail
-
build
public ProgressMonitor build()
Returns a new monitor instance with specified options.
-
messageFormatter
public ProgressMonitor.Builder messageFormatter(ProgressMonitor.ProgressFormatter formatter)
-
maxProgress
public ProgressMonitor.Builder maxProgress(long maxProgress)
Sets the maximum progress value for the monitor and returns this builder instance.
-
reportIntervalPercent
public ProgressMonitor.Builder reportIntervalPercent(int reportIntervalPercent)
Sets the reporting interval (as the number of percent increment) for the monitor and returns this builder instance. The default value is 1 meaning a message will be printed at every percent increment.
-
output
public ProgressMonitor.Builder output(java.io.OutputStream output)
Sets the output stream for the monitor and returns this builder instance. The default is stdout.
-
reportingDelegate
public ProgressMonitor.Builder reportingDelegate(java.util.Optional<ProgressReporter> reporter)
Set a reporter which will also see progress reporting
-
-