Package me.tongfei.progressbar
Class ProgressBarBuilder
java.lang.Object
me.tongfei.progressbar.ProgressBarBuilder
Builder class for
ProgressBars.- Since:
- 0.7.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate ProgressBarConsumerprivate booleanprivate Durationprivate Function<ProgressState, Optional<Duration>> private booleanprivate longprivate intprivate longprivate booleanprivate DecimalFormatprivate ChronoUnitprivate ProgressBarStyleprivate Stringprivate Stringprivate longprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()hideEta()(package private) booleansetConsumer(ProgressBarConsumer consumer) setInitialMax(long initialMax) setMaxRenderedLength(int maxRenderedLength) setSpeedUnit(ChronoUnit speedUnit) setStyle(ProgressBarStyle style) setTaskName(String task) setUpdateIntervalMillis(int updateIntervalMillis) showSpeed(DecimalFormat speedFormat) startsFrom(long processed, Duration elapsed) Sets elapsedBeforeStart duration and number of processed units.
-
Field Details
-
task
-
initialMax
private long initialMax -
updateIntervalMillis
private int updateIntervalMillis -
continuousUpdate
private boolean continuousUpdate -
style
-
consumer
-
clearDisplayOnFinish
private boolean clearDisplayOnFinish -
unitName
-
unitSize
private long unitSize -
showSpeed
private boolean showSpeed -
hideEta
private boolean hideEta -
eta
-
speedFormat
-
speedUnit
-
processed
private long processed -
elapsed
-
maxRenderedLength
private int maxRenderedLength
-
-
Constructor Details
-
ProgressBarBuilder
public ProgressBarBuilder()
-
-
Method Details
-
setTaskName
-
initialMaxIsSet
boolean initialMaxIsSet() -
setInitialMax
-
setStyle
-
setUpdateIntervalMillis
-
continuousUpdate
-
setConsumer
-
clearDisplayOnFinish
-
setUnit
-
setMaxRenderedLength
-
showSpeed
-
showSpeed
-
hideEta
-
setEtaFunction
-
setSpeedUnit
-
startsFrom
Sets elapsedBeforeStart duration and number of processed units.- Parameters:
processed- amount of processed unitselapsed- duration of
-
build
-