Class Arguments

java.lang.Object
org.refcodes.runtime.Arguments

public final class Arguments extends Object
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 Details

    • toProperties

      public static Map<String,String> toProperties(String[] aArgs)
      Creates a Map from the provided command line arguments using the ArgsPrefix.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 a Map 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

      public static Map<String,String> toProperties(String[] aArgs, String[] aPrefixes, char aDelimiter)
      Creates a Map 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.