Class HelpFormatter.Builder

java.lang.Object
org.apache.commons.cli.HelpFormatter.Builder
All Implemented Interfaces:
Supplier<HelpFormatter>
Enclosing class:
HelpFormatter

public static final class HelpFormatter.Builder extends Object implements Supplier<HelpFormatter>
Since:
1.7.0
  • Field Details

    • DEFAULT_DEPRECATED_FORMAT

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

      private Function<Option,String> deprecatedFormatFunc
      Formatter for deprecated options.
    • printStream

      private PrintWriter printStream
      The output PrintWriter, defaults to wrapping System.out.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • get

      public HelpFormatter get()
      Specified by:
      get in interface Supplier<HelpFormatter>
    • setPrintWriter

      public HelpFormatter.Builder setPrintWriter(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(Function<Option,String> showDeprecatedFunc)
      Sets whether to show deprecated options.
      Parameters:
      showDeprecatedFunc - Specify the format for the deprecated options.
      Returns:
      this.
      Since:
      1.8.0