Class CliUtility

java.lang.Object
org.refcodes.cli.CliUtility

public final class CliUtility 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

    • toParsedArgs

      public static String[] toParsedArgs(List<? extends Operand<?>>... aOperands)
      Takes all Operand instances found in the provided Lists and adds all therein found argument arrays (as of Operand.toParsedArgs()) to the result.
      Parameters:
      aOperands - The lists containing the Operand instances whose command line arguments are to be added to the result.
      Returns:
      All the command line arguments detected in the provided Operands Lists.
    • toArgsDiff

      public static String[] toArgsDiff(String[] aArgs, String[] aArgsSubset)
      Creates the difference between the provided set and the provided subset.
      Parameters:
      aArgs - The set to be used for the diff operation.
      aArgsSubset - The subset to be used for the diff operation.
      Returns:
      The difference between the set and the subset.
    • toArgsDiff

      public static String[] toArgsDiff(String[] aArgs, List<? extends Operand<?>> aArgsSubset)
      Creates the difference between the provided set and the provided Lists therein found argument arrays subset (as of Operand.toParsedArgs()).
      Parameters:
      aArgs - The set to be used for the diff operation.
      aArgsSubset - The subset to be used for the diff operation being the lists containing the Operand instances whose command line arguments are to be diffed.
      Returns:
      The difference between the set and the subset.