Added support for collections as arguments

This commit is contained in:
Erik C. Thauvin 2023-08-28 13:15:32 -07:00
parent fe376c4510
commit 7efca76693
4 changed files with 267 additions and 20 deletions

View file

@ -79,6 +79,8 @@ public class CheckstyleOperation extends AbstractProcessOperation<CheckstyleOper
/**
* Directory/file to exclude from CheckStyle. The path can be the full, absolute path, or relative to the current
* path. Multiple excludes are allowed.
*
* @see #sourceDir(Collection)
*/
public CheckstyleOperation exclude(String... path) {
for (var p : path) {
@ -87,6 +89,19 @@ public class CheckstyleOperation extends AbstractProcessOperation<CheckstyleOper
return this;
}
/**
* Directory/file to exclude from CheckStyle. The path can be the full, absolute path, or relative to the current
* path. Multiple excludes are allowed.
*
* @see #exclude(String...)
*/
public CheckstyleOperation exclude(Collection<String> path) {
for (var p : path) {
optionsWithArg.put("-e", p);
}
return this;
}
/**
* Directory/file pattern to exclude from CheckStyle. Multiple excludes are allowed.
*/
@ -219,12 +234,24 @@ public class CheckstyleOperation extends AbstractProcessOperation<CheckstyleOper
/**
* Specified the file(s) or folder(s) containing the source files to check.
*
* @see #sourceDir(Collection)
*/
public CheckstyleOperation sourceDir(String... dir) {
sourceDirs.addAll(Arrays.asList(dir));
return this;
}
/**
* Specified the file(s) or folder(s) containing the source files to check.
*
* @see #sourceDir(String...)
*/
public CheckstyleOperation sourceDir(Collection<String> dir) {
sourceDirs.addAll(dir);
return this;
}
/**
* Sets the length of the tab character. Used only with the {@link #lineColumn(String) lineColum} option.
* Default value is {@code 8}.