Class 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
    • Field Detail

      • leftPad

        private int leftPad
        The left padding.
      • indent

        private int indent
        The subsequent line indentation.
      • scalable

        private boolean scalable
        The scalable flag. Identifies text blocks that can be made narrower or wider as needed by the HelpAppendable.
      • minWidth

        private int minWidth
        The minimum width.
      • maxWidth

        private int maxWidth
        The maximum width.
    • Constructor Detail

      • Builder

        private Builder()
        Constructs a new instance. The default values are:
        • alignment = LEFT
        • leftPad = 0
        • scaling = VARIABLE
        • minWidth = 0
        • maxWidth = UNSET_MAX_WIDTH
    • Method Detail

      • get

        public TextStyle get()
        Specified by:
        get in interface java.util.function.Supplier<TextStyle>
      • 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.
      • 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.