Class UIOption.Builder<T extends UIOption<T>,B extends UIOption.Builder<T,B>>

java.lang.Object
org.apache.rat.ui.UIOption.Builder<T,B>
Type Parameters:
T - the concrete type of the UIOption this builder produces.
B - the concrete type of this builder.
Direct Known Subclasses:
AntOption.AntOptionBuilder, BaseOption.BaseOptionBuilder, CLIOption.CLIBuilder, MavenOption.MavenOptionBuilder, TestOption.TestOptionBuilder, UIOptionCollectionTest.TestingUIOption.TestingUIOptionBuilder
Enclosing class:
UIOption<T extends UIOption<T>>

public abstract static class UIOption.Builder<T extends UIOption<T>,B extends UIOption.Builder<T,B>> extends Object
The abstract UIOption Builder.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    final T
    Builds the UIOption.
    protected abstract T
    Executes the final build.
    protected abstract Function<org.apache.commons.cli.Option,CasedString>
    Returns a function to convert an Option to a CasedString that is the native name for the option.
    protected final org.apache.commons.cli.Option
    Gets the option.
    option(org.apache.commons.cli.Option option)
    Sets the Option that the UIOption will be generated from.
    protected final UIOptionCollection<T>
    Gets the UIOptionCollection that the options will be added to.
    Sets the UIOptionCollection that the UIOptions will be added to.
    protected final B
    Returns this builder cast to the builder type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Builder

      protected Builder()
      Constructor.
  • Method Details

    • getNameFactory

      protected abstract Function<org.apache.commons.cli.Option,CasedString> getNameFactory()
      Returns a function to convert an Option to a CasedString that is the native name for the option.
      Returns:
      a function to convert an Option to a CasedString that is the native name for the option.
    • option

      protected final org.apache.commons.cli.Option option()
      Gets the option.
      Returns:
      the option or null if the option is not set.
    • optionCollection

      protected final UIOptionCollection<T> optionCollection()
      Gets the UIOptionCollection that the options will be added to.
      Returns:
      UIOptionCollection that the options will be added to.
    • self

      protected final B self()
      Returns this builder cast to the builder type. Useful for implementing fluent builders.
      Returns:
      this builder.
    • optionCollection

      public B optionCollection(UIOptionCollection<T> optionCollection)
      Sets the UIOptionCollection that the UIOptions will be added to.
      Parameters:
      optionCollection - the UIOptionCollection that the UIOptions will be added to.
      Returns:
      this
    • option

      public B option(org.apache.commons.cli.Option option)
      Sets the Option that the UIOption will be generated from.
      Parameters:
      option - to build the UIOption from.
      Returns:
      this
    • doBuild

      protected abstract T doBuild() throws IllegalArgumentException
      Executes the final build.
      Returns:
      An instance of the UIOption.
      Throws:
      IllegalArgumentException - if values are not set correctly.
    • build

      public final T build() throws IllegalArgumentException
      Builds the UIOption.
      Returns:
      the UIOption.
      Throws:
      IllegalArgumentException - if values are not set correctly.