com.google.caliper.Arguments

Here are the examples of the java api class com.google.caliper.Arguments taken from open source projects.

1. CaliperRunner#adjustArgs()

Project: minimal-json
Source File: CaliperRunner.java
View license
String[] adjustArgs(String[] args) {
    List<String> adjustedArgs = new ArrayList<>();
    adjustedArgs.add(benchmark.getName());
    adjustedArgs.addAll(Arrays.asList(args));
    Arguments parsed = Arguments.parse(adjustedArgs.toArray(new String[0]));
    // If a param wasn't specified in 'args', use the default value
    for (Map.Entry<String, String[]> paramDefault : parameterDefaults.entrySet()) {
        if (!parsed.getUserParameters().containsKey(paramDefault.getKey())) {
            adjustedArgs.add("-D" + paramDefault.getKey() + "=" + join(paramDefault.getValue(), ","));
        }
    }
    if (resultsFile != null) {
        if (parsed.getSaveResultsFile() != null) {
            throw new UserException.DuplicateParameterException("--saveResults is already used internally");
        }
        adjustedArgs.add("--saveResults");
        adjustedArgs.add(resultsFile.getAbsolutePath());
    }
    return adjustedArgs.toArray(new String[0]);
}