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.
  • Field Details

  • Constructor Details

    • Builder

      protected Builder()
      Constructs a new instance.

      Sets showSince to true.

  • Method Details

    • asThis

      protected B asThis()
      Returns this instance cast to B.
      Returns:
      this instance cast to B.
    • getComparator

      protected Comparator<Option> getComparator()
      Gets the comparator to sort lists of options.
      Returns:
      the comparator to sort lists of options.
    • getHelpAppendable

      protected HelpAppendable getHelpAppendable()
      Returns:
      the HelpAppendable.
    • getOptionFormatBuilder

      protected OptionFormatter.Builder getOptionFormatBuilder()
      Gets OptionFormatter.Builder to use to format options in the table.
      Returns:
      the OptionFormatter.Builder to use to format options in the table.
    • getOptionGroupSeparator

      protected String getOptionGroupSeparator()
      Gets string to separate option groups.
      Returns:
      the string to separate option groups.
    • setComparator

      public B setComparator(Comparator<Option> comparator)
      Sets the comparator to use for sorting options. If set to null no sorting is performed.
      Parameters:
      comparator - The comparator to use for sorting options.
      Returns:
      this
    • setHelpAppendable

      public B setHelpAppendable(HelpAppendable helpAppendable)
      Sets the HelpAppendable.
      Parameters:
      helpAppendable - the HelpAppendable to use.
      Returns:
      this
    • setOptionFormatBuilder

      public B setOptionFormatBuilder(OptionFormatter.Builder optionFormatBuilder)
      Parameters:
      optionFormatBuilder - the OptionFormatter.Builder to use.
      Returns:
      this
    • setOptionGroupSeparator

      public B setOptionGroupSeparator(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