java.lang.Object
org.refcodes.runtime.Arguments
This utility class provides method useful for the refcodes-cli artifact and
whose implementation has been motivated by the implementation of the
refcodes-cli artifact.
-
Method Summary
Modifier and TypeMethodDescriptiontoProperties(String[] aArgs) Creates aMapfrom the provided command line arguments using theArgsPrefix.toPrefixes()prefixes to identify the keys (and the values) from the provided arguments.toProperties(String[] aArgs, String[] aPrefixes, char aDelimiter) Creates aMapfrom the provided command line arguments using the provided prefixes to identify the keys (and the values) from the provided arguments.toProperties(String[] aArgs, Collection<String> aPrefixes, char aDelimiter) Creates aMapfrom the provided command line arguments using the provided prefixes to identify the keys (and the values) from the provided arguments.
-
Method Details
-
toProperties
-
toProperties
public static Map<String,String> toProperties(String[] aArgs, Collection<String> aPrefixes, char aDelimiter) Creates aMapfrom the provided command line arguments using the provided prefixes to identify the keys (and the values) from the provided arguments.- Parameters:
aArgs- The command line arguments to convert to properties.aPrefixes- The prefixes to be used to identify options.aDelimiter- The delimiter to use when generating non colliding keys.- Returns:
- The
Mapcontaining the determined properties.
-
toProperties
Creates aMapfrom the provided command line arguments using the provided prefixes to identify the keys (and the values) from the provided arguments.- Parameters:
aArgs- The command line arguments to convert to properties.aPrefixes- The prefixes to be used to identify options.aDelimiter- The delimiter to use when generating non colliding keys.- Returns:
- The
Mapcontaining the determined properties.
-