Class HelpFormatter.Builder

  • All Implemented Interfaces:
    java.util.function.Supplier<HelpFormatter>
    Enclosing class:
    HelpFormatter

    public static final class HelpFormatter.Builder
    extends java.lang.Object
    implements java.util.function.Supplier<HelpFormatter>
    Since:
    1.7.0
    • Field Detail

      • DEFAULT_DEPRECATED_FORMAT

        private static final java.util.function.Function<Option,​java.lang.String> DEFAULT_DEPRECATED_FORMAT
        A function to convert a description (not null) and a deprecated Option (not null) to help description
      • deprecatedFormatFunc

        private java.util.function.Function<Option,​java.lang.String> deprecatedFormatFunc
        Formatter for deprecated options.
      • printStream

        private java.io.PrintWriter printStream
        The output PrintWriter, defaults to wrapping System.out.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setPrintWriter

        public HelpFormatter.Builder setPrintWriter​(java.io.PrintWriter printWriter)
        Sets the output PrintWriter, defaults to wrapping System.out.
        Parameters:
        printWriter - the output PrintWriter, not null.
        Returns:
        this.
      • setShowDeprecated

        public HelpFormatter.Builder setShowDeprecated​(boolean useDefaultFormat)
        Sets whether to show deprecated options.
        Parameters:
        useDefaultFormat - if true use the default format, otherwise clear the formatter.
        Returns:
        this.
      • setShowDeprecated

        public HelpFormatter.Builder setShowDeprecated​(java.util.function.Function<Option,​java.lang.String> showDeprecatedFunc)
        Sets whether to show deprecated options.
        Parameters:
        showDeprecatedFunc - Specify the format for the deprecated options.
        Returns:
        this.
        Since:
        1.8.0