Class ProgressBar.Builder
java.lang.Object
com.helixframework.console.progress.ProgressBar.Builder
- Enclosing class:
- ProgressBar
Builder class for creating and configuring instances of ProgressBar.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs and returns a new instance of the ProgressBar class using the configuration specified in the Builder.setBarLength(int barLength) Sets the length of the progress bar, which determines the number of characters used for the visual representation of the bar.setEmptyChar(char emptyChar) Sets the character used to represent the empty or incomplete portion of the progress bar.Sets the label for the progress bar.setProgressChar(char progressChar) Sets the character used to represent the completed portion of the progress bar.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setBarLength
Sets the length of the progress bar, which determines the number of characters used for the visual representation of the bar.- Parameters:
barLength- the desired length of the progress bar, represented as the number of characters- Returns:
- the current Builder instance for method chaining
-
setProgressChar
Sets the character used to represent the completed portion of the progress bar.- Parameters:
progressChar- the character to be used for the completed progress indicator- Returns:
- the current Builder instance for method chaining
-
setEmptyChar
Sets the character used to represent the empty or incomplete portion of the progress bar.- Parameters:
emptyChar- the character to be used for the empty progress indicator- Returns:
- the current Builder instance for method chaining
-
setLabel
Sets the label for the progress bar. The label is displayed next to the progress bar to provide context or additional information.- Parameters:
label- the text to display as the label of the progress bar- Returns:
- the current Builder instance for method chaining
-
build
Constructs and returns a new instance of the ProgressBar class using the configuration specified in the Builder.- Returns:
- a configured instance of ProgressBar
-