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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TextStyle.AlignmentThe alignment.private intThe subsequent line indentation.private intThe left padding.private intThe maximum width.private intThe minimum width.private booleanThe scalable flag. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()intGets the currently specified indent value.intGets the currently specified leftPad.intGets the currently specified maximum width value.intGets the currently specified minimum width value.booleanSpecifies 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.
-
Field Details
-
alignment
The alignment. -
leftPad
private int leftPadThe left padding. -
indent
private int indentThe subsequent line indentation. -
scalable
private boolean scalableThe scalable flag. Identifies text blocks that can be made narrower or wider as needed by the HelpAppendable. -
minWidth
private int minWidthThe minimum width. -
maxWidth
private int maxWidthThe maximum width.
-
-
Constructor Details
-
Builder
private Builder()Constructs a new instance. The default values are:- alignment = LEFT
- leftPad = 0
- scaling = VARIABLE
- minWidth = 0
- maxWidth = UNSET_MAX_WIDTH
-
-
Method Details
-
get
-
getIndent
public int getIndent()Gets the currently specified indent value.- Returns:
- The currently specified indent value.
-
getLeftPad
public int getLeftPad()Gets the currently specified leftPad.- Returns:
- The currently specified leftPad.
-
getMaxWidth
public int getMaxWidth()Gets the currently specified maximum width value.- Returns:
- The currently specified maximum width value.
-
getMinWidth
public int getMinWidth()Gets the currently specified minimum width value.- Returns:
- The currently specified minimum width value.
-
isScalable
public boolean 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:
thisinstance.
-
setTextStyle
Sets all properties from the given text style.- Parameters:
style- the source text style.- Returns:
thisinstance.
-