Package org.apache.commons.cli.help
Class AbstractHelpFormatter.Builder<B extends AbstractHelpFormatter.Builder<B,T>,T extends AbstractHelpFormatter>
java.lang.Object
org.apache.commons.cli.help.AbstractHelpFormatter.Builder<B,T>
- Type Parameters:
B- The builder type.T- The type to build.
- All Implemented Interfaces:
Supplier<T>
- Direct Known Subclasses:
HelpFormatter.Builder
- Enclosing class:
AbstractHelpFormatter
public abstract static class AbstractHelpFormatter.Builder<B extends AbstractHelpFormatter.Builder<B,T>,T extends AbstractHelpFormatter>
extends Object
implements Supplier<T>
Abstracts building instances for subclasses.
- helpAppendable = a
TextHelpAppendablewriting toSystem.out - optionFormatter.Builder = the default
OptionFormatter.Builder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BasThis()Returns this instance cast toB.protected Comparator<Option> Gets the comparator to sort lists of options.protected HelpAppendableGetsHelpAppendable.protected OptionFormatter.BuilderGetsOptionFormatter.Builderto use to format options in the table.protected StringGets string to separate option groups.setComparator(Comparator<Option> comparator) Sets the comparator to use for sorting options.setHelpAppendable(HelpAppendable helpAppendable) Sets theHelpAppendable.setOptionFormatBuilder(OptionFormatter.Builder optionFormatBuilder) Sets theOptionFormatter.Builder.setOptionGroupSeparator(String optionGroupSeparator) Sets the OptionGroup separator.
-
Constructor Details
-
Builder
protected Builder()Constructs a new instance.Sets
showSincetotrue.
-
-
Method Details
-
asThis
Returns this instance cast toB.- Returns:
- this instance cast to
B.
-
getComparator
Gets the comparator to sort lists of options.- Returns:
- the comparator to sort lists of options.
-
getHelpAppendable
GetsHelpAppendable.- Returns:
- the
HelpAppendable.
-
getOptionFormatBuilder
GetsOptionFormatter.Builderto use to format options in the table.- Returns:
- the
OptionFormatter.Builderto use to format options in the table.
-
getOptionGroupSeparator
Gets string to separate option groups.- Returns:
- the string to separate option groups.
-
setComparator
Sets the comparator to use for sorting options. If set tonullno sorting is performed.- Parameters:
comparator- The comparator to use for sorting options.- Returns:
- this
-
setHelpAppendable
Sets theHelpAppendable.- Parameters:
helpAppendable- theHelpAppendableto use.- Returns:
- this
-
setOptionFormatBuilder
Sets theOptionFormatter.Builder.- Parameters:
optionFormatBuilder- theOptionFormatter.Builderto use.- Returns:
- this
-
setOptionGroupSeparator
Sets the OptionGroup separator. Normally " | " or something similar to denote that only one option may be chosen.- Parameters:
optionGroupSeparator- the string to separate option group elements with.- Returns:
- this
-