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.ObjectBuilder class for a customizable progress monitor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProgressMonitorbuild()Returns a new monitor instance with specified options.ProgressMonitor.BuildermaxProgress(long maxProgress)Sets the maximum progress value for the monitor and returns this builder instance.ProgressMonitor.BuildermessageFormatter(ProgressMonitor.ProgressFormatter formatter)ProgressMonitor.Builderoutput(java.io.OutputStream output)Sets the output stream for the monitor and returns this builder instance.ProgressMonitor.BuilderreportingDelegate(java.util.Optional<ProgressReporter> reporter)Set a reporter which will also see progress reportingProgressMonitor.BuilderreportIntervalPercent(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
-
-