Class AbstractHelpFormatter.Builder<B extends AbstractHelpFormatter.Builder<B,​T>,​T extends AbstractHelpFormatter>

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

      • comparator

        private java.util.Comparator<Option> comparator
        The comparator to sort lists of options
      • optionGroupSeparator

        private java.lang.String optionGroupSeparator
        The string to separate option groups.
    • Constructor Detail

      • Builder

        protected Builder()
        Constructs a new instance.

        Sets showSince to true.

    • Method Detail

      • asThis

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

        protected java.util.Comparator<Option> getComparator()
        Gets the comparator to sort lists of options.
        Returns:
        the comparator to sort lists of options.
      • 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 to null no sorting is performed.
        Parameters:
        comparator - The comparator to use for sorting options.
        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