Class LayeredOptions<O extends Options>

java.lang.Object
org.apache.maven.cling.invoker.LayeredOptions<O>
Type Parameters:
O - The type of options.
All Implemented Interfaces:
Options
Direct Known Subclasses:
LayeredMavenOptions

public abstract class LayeredOptions<O extends Options> extends Object implements Options
Options that are "layered" by precedence order.
  • Field Details

  • Constructor Details

    • LayeredOptions

      protected LayeredOptions(List<O> options)
  • Method Details

    • userProperties

      public Optional<Map<String,String>> userProperties()
      Description copied from interface: Options
      Returns the user-defined properties for the Maven execution.
      Specified by:
      userProperties in interface Options
      Returns:
      an Optional containing the map of user properties, or empty if not set
    • source

      public String source()
      Description copied from interface: Options
      Returns a simple designator of the options source, such as "cli", "maven.conf", etc.
      Specified by:
      source in interface Options
      Returns:
      a string representing the source of the options
    • showVersionAndExit

      public Optional<Boolean> showVersionAndExit()
      Description copied from interface: Options
      Indicates whether to show the version information and exit.
      Specified by:
      showVersionAndExit in interface Options
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • showVersion

      public Optional<Boolean> showVersion()
      Description copied from interface: Options
      Indicates whether to show the version information.
      Specified by:
      showVersion in interface Options
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • quiet

      public Optional<Boolean> quiet()
      Description copied from interface: Options
      Indicates whether to run in quiet mode.
      Specified by:
      quiet in interface Options
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • verbose

      public Optional<Boolean> verbose()
      Description copied from interface: Options
      Indicates whether to run in verbose mode.
      Specified by:
      verbose in interface Options
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • showErrors

      public Optional<Boolean> showErrors()
      Description copied from interface: Options
      Indicates whether to show error stack traces.
      Specified by:
      showErrors in interface Options
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • failOnSeverity

      public Optional<String> failOnSeverity()
      Description copied from interface: Options
      Returns the severity level at which the build should fail.
      Specified by:
      failOnSeverity in interface Options
      Returns:
      an Optional containing the fail-on-severity string, or empty if not set
    • nonInteractive

      public Optional<Boolean> nonInteractive()
      Description copied from interface: Options
      Indicates whether to run in non-interactive mode.
      Specified by:
      nonInteractive in interface Options
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • forceInteractive

      public Optional<Boolean> forceInteractive()
      Description copied from interface: Options
      Indicates whether to force interactive mode.
      Specified by:
      forceInteractive in interface Options
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • altUserSettings

      public Optional<String> altUserSettings()
      Description copied from interface: Options
      Returns the path to an alternate user settings file.
      Specified by:
      altUserSettings in interface Options
      Returns:
      an Optional containing the file path, or empty if not set
    • altProjectSettings

      public Optional<String> altProjectSettings()
      Description copied from interface: Options
      Returns the path to an alternate project settings file.
      Specified by:
      altProjectSettings in interface Options
      Returns:
      an Optional containing the file path, or empty if not set
    • altInstallationSettings

      public Optional<String> altInstallationSettings()
      Description copied from interface: Options
      Returns the path to an alternate installation settings file.
      Specified by:
      altInstallationSettings in interface Options
      Returns:
      an Optional containing the file path, or empty if not set
    • altUserToolchains

      public Optional<String> altUserToolchains()
      Description copied from interface: Options
      Returns the path to an alternate user toolchains file.
      Specified by:
      altUserToolchains in interface Options
      Returns:
      an Optional containing the file path, or empty if not set
    • altInstallationToolchains

      public Optional<String> altInstallationToolchains()
      Description copied from interface: Options
      Returns the path to an alternate installation toolchains file.
      Specified by:
      altInstallationToolchains in interface Options
      Returns:
      an Optional containing the file path, or empty if not set
    • logFile

      public Optional<String> logFile()
      Description copied from interface: Options
      Returns the path to the log file.
      Specified by:
      logFile in interface Options
      Returns:
      an Optional containing the file path, or empty if not set
    • rawStreams

      public Optional<Boolean> rawStreams()
      Description copied from interface: Options
      Returns whether raw streams should be logged.
      Specified by:
      rawStreams in interface Options
      Returns:
      a boolean indicating whether raw streams should be logged
    • color

      public Optional<String> color()
      Description copied from interface: Options
      Returns the color setting for console output.
      Specified by:
      color in interface Options
      Returns:
      an Optional containing the color setting, or empty if not set
    • help

      public Optional<Boolean> help()
      Description copied from interface: Options
      Indicates whether to show help information.
      Specified by:
      help in interface Options
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • warnAboutDeprecatedOptions

      public void warnAboutDeprecatedOptions(ParserRequest request, Consumer<String> printWriter)
      Description copied from interface: Options
      Emits warning messages if deprecated options are used.
      Specified by:
      warnAboutDeprecatedOptions in interface Options
      printWriter - the string consumer to use for output
    • displayHelp

      public void displayHelp(ParserRequest request, Consumer<String> printWriter)
      Description copied from interface: Options
      Displays help information for these options.
      Specified by:
      displayHelp in interface Options
      printWriter - the string consumer to use for output
    • returnFirstPresentOrEmpty

      protected <T> Optional<T> returnFirstPresentOrEmpty(Function<O,Optional<T>> getter)
    • collectListIfPresentOrEmpty

      protected Optional<List<String>> collectListIfPresentOrEmpty(Function<O,Optional<List<String>>> getter)
    • collectMapIfPresentOrEmpty

      protected Optional<Map<String,String>> collectMapIfPresentOrEmpty(Function<O,Optional<Map<String,String>>> getter)