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:
java.util.function.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 java.lang.Object implements java.util.function.Supplier<T>
Abstracts building instances for subclasses.- helpAppendable = a
TextHelpAppendablewriting toSystem.out - optionFormatter.Builder = the default
OptionFormatter.Builder
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BasThis()Returns this instance cast toB.protected java.util.Comparator<Option>getComparator()Gets the comparator to sort lists of options.protected HelpAppendablegetHelpAppendable()GetsHelpAppendable.protected OptionFormatter.BuildergetOptionFormatBuilder()GetsOptionFormatter.Builderto use to format options in the table.protected java.lang.StringgetOptionGroupSeparator()Gets string to separate option groups.BsetComparator(java.util.Comparator<Option> comparator)Sets the comparator to use for sorting options.BsetHelpAppendable(HelpAppendable helpAppendable)Sets theHelpAppendable.BsetOptionFormatBuilder(OptionFormatter.Builder optionFormatBuilder)Sets theOptionFormatter.Builder.BsetOptionGroupSeparator(java.lang.String optionGroupSeparator)Sets the OptionGroup separator.
-
-
-
Constructor Detail
-
Builder
protected Builder()
Constructs a new instance.Sets
showSincetotrue.
-
-
Method Detail
-
getComparator
protected java.util.Comparator<Option> getComparator()
Gets the comparator to sort lists of options.- Returns:
- the comparator to sort lists of options.
-
getHelpAppendable
protected HelpAppendable getHelpAppendable()
GetsHelpAppendable.- Returns:
- the
HelpAppendable.
-
getOptionFormatBuilder
protected OptionFormatter.Builder getOptionFormatBuilder()
GetsOptionFormatter.Builderto use to format options in the table.- Returns:
- the
OptionFormatter.Builderto use to format options in the table.
-
getOptionGroupSeparator
protected java.lang.String getOptionGroupSeparator()
Gets string to separate option groups.- Returns:
- the string to separate option groups.
-
setComparator
public B setComparator(java.util.Comparator<Option> comparator)
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
public B setHelpAppendable(HelpAppendable helpAppendable)
Sets theHelpAppendable.- Parameters:
helpAppendable- theHelpAppendableto use.- Returns:
- this
-
setOptionFormatBuilder
public B setOptionFormatBuilder(OptionFormatter.Builder optionFormatBuilder)
Sets theOptionFormatter.Builder.- Parameters:
optionFormatBuilder- theOptionFormatter.Builderto use.- Returns:
- this
-
setOptionGroupSeparator
public B setOptionGroupSeparator(java.lang.String optionGroupSeparator)
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
-
-