Class ArgumentsUtils
java.lang.Object
it.tidalwave.datamanager.application.nogui.args.ArgumentsUtils
Some generic utils to manipulate
ApplicationArguments
.- Author:
- Fabrizio Giudici
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindBadOptions
(org.springframework.boot.ApplicationArguments args, Set<String> validOptions) Find options that are not contained in a given valid collection.getIntOption
(org.springframework.boot.ApplicationArguments args, String name) Extracts an optional integer option.getStringOption
(org.springframework.boot.ApplicationArguments args, String name) Extracts an optional string option.
-
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 argumentname
- 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 argumentname
- 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 argumentsvalidOptions
- the valid options- Returns:
- the bad options
-