Package org.apache.commons.cli
Class HelpFormatter.Builder
- java.lang.Object
-
- org.apache.commons.cli.HelpFormatter.Builder
-
- All Implemented Interfaces:
java.util.function.Supplier<HelpFormatter>
- Enclosing class:
- HelpFormatter
public static class HelpFormatter.Builder extends java.lang.Object implements java.util.function.Supplier<HelpFormatter>
BuildsHelpFormatter.- Since:
- 1.7.0
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HelpFormatterget()HelpFormatter.BuildersetPrintWriter(java.io.PrintWriter printWriter)Sets the output PrintWriter, defaults to wrappingSystem.out.HelpFormatter.BuildersetShowDeprecated(boolean useDefaultFormat)Sets whether to show deprecated options.HelpFormatter.BuildersetShowDeprecated(java.util.function.Function<Option,java.lang.String> deprecatedFormatFunction)Sets whether to show deprecated options.HelpFormatter.BuildersetShowSince(boolean showSince)Sets whether to show the date the option was first added.
-
-
-
Constructor Detail
-
Builder
public Builder()
Constructs a new instance.
-
-
Method Detail
-
get
public HelpFormatter get()
- Specified by:
getin interfacejava.util.function.Supplier<HelpFormatter>
-
setPrintWriter
public HelpFormatter.Builder setPrintWriter(java.io.PrintWriter printWriter)
Sets the output PrintWriter, defaults to wrappingSystem.out.- Parameters:
printWriter- the output PrintWriter, not null.- Returns:
thisinstance.
-
setShowDeprecated
public HelpFormatter.Builder setShowDeprecated(boolean useDefaultFormat)
Sets whether to show deprecated options.- Parameters:
useDefaultFormat- iftrueuse the default format, otherwise clear the formatter.- Returns:
thisinstance.
-
setShowDeprecated
public HelpFormatter.Builder setShowDeprecated(java.util.function.Function<Option,java.lang.String> deprecatedFormatFunction)
Sets whether to show deprecated options.- Parameters:
deprecatedFormatFunction- Specify the format for the deprecated options.- Returns:
thisinstance.- Since:
- 1.8.0
-
setShowSince
public HelpFormatter.Builder setShowSince(boolean showSince)
Sets whether to show the date the option was first added.- Parameters:
showSince- if @{code true} the date the options was first added will be shown.- Returns:
- this builder.
- Since:
- 1.9.0
-
-