Class ArgumentsUtils

java.lang.Object
it.tidalwave.datamanager.application.nogui.args.ArgumentsUtils

public final class ArgumentsUtils extends Object
Some generic utils to manipulate ApplicationArguments.
Author:
Fabrizio Giudici
  • Constructor Details

    • ArgumentsUtils

      public ArgumentsUtils()
  • Method Details

    • getIntOption

      @Nonnull public static Optional<Integer> getIntOption(@Nonnull org.springframework.boot.ApplicationArguments args, @Nonnull String name)
      Extracts an optional integer option.
      Parameters:
      args - the argument
      name - the name of the option
      Returns:
      the value of the option
    • getStringOption

      @Nonnull public static Optional<String> getStringOption(@Nonnull org.springframework.boot.ApplicationArguments args, @Nonnull String name)
      Extracts an optional string option.
      Parameters:
      args - the argument
      name - the name of the option
      Returns:
      the value of the option
    • findBadOptions

      @Nonnull public static Set<String> findBadOptions(@Nonnull org.springframework.boot.ApplicationArguments args, @Nonnull Set<String> validOptions)
      Find options that are not contained in a given valid collection.
      Parameters:
      args - the application arguments
      validOptions - the valid options
      Returns:
      the bad options