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 aMap
from 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 aMap
from 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 aMap
from the provided command line arguments using the provided prefixes to identify the keys (and the values) from the provided arguments.
-
Method Details
-
toProperties
Creates aMap
from the provided command line arguments using theArgsPrefix.toPrefixes()
prefixes to identify the keys (and the values) from the provided arguments.- Parameters:
aArgs
- The command line arguments to convert to properties.- Returns:
- The
Map
containing the determined properties.
-
toProperties
public static Map<String,String> toProperties(String[] aArgs, Collection<String> aPrefixes, char aDelimiter) Creates aMap
from 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
Map
containing the determined properties.
-
toProperties
Creates aMap
from 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
Map
containing the determined properties.
-