Class UIOptionCollection<T extends UIOption<T>>

java.lang.Object
org.apache.rat.ui.UIOptionCollection<T>
Type Parameters:
T - the AbstractOption implementation.
Direct Known Subclasses:
AntOptionCollection, CLIOptionCollection, MavenOptionCollection

public class UIOptionCollection<T extends UIOption<T>> extends Object
A collection of options supported by the UI. This includes RAT options and UI specific options.
  • Constructor Details

    • UIOptionCollection

      protected UIOptionCollection(UIOptionCollection.Builder<T,?> builder)
      Construct the UIOptionCollection from the builder.
      Parameters:
      builder - the builder to build from.
  • Method Details

    • isSelected

      public final boolean isSelected(Arg arg)
      Checks if an Arg is selected.
      Parameters:
      arg - the Arg to check.
      Returns:
      true if the arg is selected.
    • getSelected

      public final Optional<org.apache.commons.cli.Option> getSelected(Arg arg)
      Gets the selected Option for the arg.
      Parameters:
      arg - the arg to check.
      Returns:
      an Optional containing the selected option, or an empty Optional if none was selected.
    • getUnsupportedOptions

      public final org.apache.commons.cli.Options getUnsupportedOptions()
      Gets the collection of unsupported Options.
      Returns:
      the Options comprised for the unsupported options.
    • getMappedOption

      public final Optional<T> getMappedOption(org.apache.commons.cli.Option option)
      Gets the UiOption instance for the Option.
      Parameters:
      option - the option to find the instance of.
      Returns:
      a UIOption instance that wraps the option.
    • getOptions

      public final org.apache.commons.cli.Options getOptions()
      Gets an Options that contains the RAT Arg defined Option instances that are understood by this collection. OptionGroups are registered in the resulting Options object.
      Returns:
      an Options that contains the RAT Arg defined Option instances that are understood by this collection.
    • getMappedOptions

      public final Stream<T> getMappedOptions()
      Gets the Stream of AbstractOption implementations understood by this collection.
      Returns:
      the Stream of AbstractOption implementations understood by this collection.
    • getOptionMap

      public final Map<String,T> getOptionMap()
      Gets a map client option name to specified AbstractOption implementation.
      Returns:
      a map client option name to specified AbstractOption implementation
    • additionalOptions

      public final org.apache.commons.cli.Options additionalOptions()
      Gets the additional options understood by this collection.
      Returns:
      the additional options understood by this collection.
    • defaultValue

      public final String defaultValue(org.apache.commons.cli.Option option)
      Gets the default value for the option.
      Parameters:
      option - the option to lookup.
      Returns:
      the default value or null if not set.