Package org.apache.commons.cli.help
Class TextStyle.Builder
- java.lang.Object
-
- org.apache.commons.cli.help.TextStyle.Builder
-
- All Implemented Interfaces:
java.util.function.Supplier<TextStyle>
- Enclosing class:
- TextStyle
public static final class TextStyle.Builder extends java.lang.Object implements java.util.function.Supplier<TextStyle>
The builder for the TextStyle. The default values are:- alignment = LEFT
- leftPad = 0
- scaling = VARIABLE
- minWidth = 0
- maxWidth = UNSET_MAX_WIDTH
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextStyleget()intgetIndent()Gets the currently specified indent value.intgetLeftPad()Gets the currently specified leftPad.intgetMaxWidth()Gets the currently specified maximum width value.intgetMinWidth()Gets the currently specified minimum width value.booleanisScalable()Specifies if the column can be made wider or to narrower width to fit constraints of the HelpAppendable and formatting.TextStyle.BuildersetAlignment(TextStyle.Alignment alignment)Sets the alignment.TextStyle.BuildersetIndent(int indent)Sets the indent value.TextStyle.BuildersetLeftPad(int leftPad)Sets the left padding.TextStyle.BuildersetMaxWidth(int maxWidth)Sets the currently specified minimum width.TextStyle.BuildersetMinWidth(int minWidth)Sets the currently specified minimum width.TextStyle.BuildersetScalable(boolean scalable)Sets whether the column can be made wider or to narrower width to fit constraints of the HelpAppendable and formatting.TextStyle.BuildersetTextStyle(TextStyle style)Sets all properties from the given text style.
-
-
-
Method Detail
-
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
public TextStyle.Builder setAlignment(TextStyle.Alignment alignment)
Sets the alignment.- Parameters:
alignment- the desired alignment.- Returns:
- this
-
setIndent
public TextStyle.Builder setIndent(int indent)
Sets the indent value.- Parameters:
indent- the new indent value.- Returns:
- this
-
setLeftPad
public TextStyle.Builder setLeftPad(int leftPad)
Sets the left padding.- Parameters:
leftPad- the new left padding.- Returns:
- this
-
setMaxWidth
public TextStyle.Builder setMaxWidth(int maxWidth)
Sets the currently specified minimum width.- Parameters:
maxWidth- The currently specified maximum width.- Returns:
- this
-
setMinWidth
public TextStyle.Builder setMinWidth(int minWidth)
Sets the currently specified minimum width.- Parameters:
minWidth- The currently specified minimum width.- Returns:
- this
-
setScalable
public TextStyle.Builder setScalable(boolean scalable)
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
public TextStyle.Builder setTextStyle(TextStyle style)
Sets all properties from the given text style.- Parameters:
style- the source text style.- Returns:
- this instance.
-
-