Package org.apache.rat.ui
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:
CLIOption.CLIBuilder
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 -
Method Summary
Modifier and TypeMethodDescriptionfinal Tbuild()Builds the UIOption.protected abstract TdoBuild()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.Optionoption()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.optionCollection(UIOptionCollection<T> optionCollection) Sets the UIOptionCollection that the UIOptions will be added to.protected final Bself()Returns this builder cast to the builder type.
-
Constructor Details
-
Builder
protected Builder()Constructor.
-
-
Method Details
-
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
nullif the option is not set.
-
optionCollection
Gets the UIOptionCollection that the options will be added to.- Returns:
- UIOptionCollection that the options will be added to.
-
self
Returns this builder cast to the builder type. Useful for implementing fluent builders.- Returns:
- this builder.
-
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
Sets the Option that the UIOption will be generated from.- Parameters:
option- to build the UIOption from.- Returns:
- this
-
doBuild
Executes the final build.- Returns:
- An instance of the UIOption.
- Throws:
IllegalArgumentException- if values are not set correctly.
-
build
Builds the UIOption.- Returns:
- the UIOption.
- Throws:
IllegalArgumentException- if values are not set correctly.
-