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
TextHelpAppendable
writing toSystem.out
- optionFormatter.Builder = the default
OptionFormatter.Builder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected B
asThis()
Returns this instance cast toB
.protected Comparator
<Option> Gets the comparator to sort lists of options.protected HelpAppendable
GetsHelpAppendable
.protected OptionFormatter.Builder
GetsOptionFormatter.Builder
to use to format options in the table.protected String
Gets 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
showSince
totrue
.
-
-
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.Builder
to use to format options in the table.- Returns:
- the
OptionFormatter.Builder
to 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 tonull
no sorting is performed.- Parameters:
comparator
- The comparator to use for sorting options.- Returns:
- this
-
setHelpAppendable
Sets theHelpAppendable
.- Parameters:
helpAppendable
- theHelpAppendable
to use.- Returns:
- this
-
setOptionFormatBuilder
Sets theOptionFormatter.Builder
.- Parameters:
optionFormatBuilder
- theOptionFormatter.Builder
to 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
-