Package org.apache.commons.cli.help
Class TextStyle.Builder
java.lang.Object
org.apache.commons.cli.help.TextStyle.Builder
- Enclosing class:
TextStyle
The builder for the TextStyle. The default values are:
- alignment = LEFT
- leftPad = 0
- scaling = VARIABLE
- minWidth = 0
- maxWidth = UNSET_MAX_WIDTH
-
Method Summary
Modifier and TypeMethodDescriptionget()
int
Gets the currently specified indent value.int
Gets the currently specified leftPad.int
Gets the currently specified maximum width value.int
Gets the currently specified minimum width value.boolean
Specifies if the column can be made wider or to narrower width to fit constraints of the HelpAppendable and formatting.setAlignment
(TextStyle.Alignment alignment) Sets the alignment.setIndent
(int indent) Sets the indent value.setLeftPad
(int leftPad) Sets the left padding.setMaxWidth
(int maxWidth) Sets the currently specified minimum width.setMinWidth
(int minWidth) Sets the currently specified minimum width.setScalable
(boolean scalable) Sets whether the column can be made wider or to narrower width to fit constraints of the HelpAppendable and formatting.setTextStyle
(TextStyle style) Sets all properties from the given text style.
-
Method Details
-
get
-
getIndent
Gets the currently specified indent value.- Returns:
- The currently specified indent value.
-
getLeftPad
Gets the currently specified leftPad.- Returns:
- The currently specified leftPad.
-
getMaxWidth
Gets the currently specified maximum width value.- Returns:
- The currently specified maximum width value.
-
getMinWidth
Gets the currently specified minimum width value.- Returns:
- The currently specified minimum width value.
-
isScalable
Specifies if the column can be made wider or to narrower width to fit constraints of the HelpAppendable and formatting.- Returns:
- The currently specified scaling value.
-
setAlignment
Sets the alignment.- Parameters:
alignment
- the desired alignment.- Returns:
- this
-
setIndent
Sets the indent value.- Parameters:
indent
- the new indent value.- Returns:
- this
-
setLeftPad
Sets the left padding.- Parameters:
leftPad
- the new left padding.- Returns:
- this
-
setMaxWidth
Sets the currently specified minimum width.- Parameters:
maxWidth
- The currently specified maximum width.- Returns:
- this
-
setMinWidth
Sets the currently specified minimum width.- Parameters:
minWidth
- The currently specified minimum width.- Returns:
- this
-
setScalable
Sets whether the column can be made wider or to narrower width to fit constraints of the HelpAppendable and formatting.- Parameters:
scalable
- Whether the text width can be adjusted.- Returns:
- this instance.
-
setTextStyle
Sets all properties from the given text style.- Parameters:
style
- the source text style.- Returns:
- this instance.
-