aboutsummaryrefslogtreecommitdiffstats
path: root/pf4j
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2015-12-24 09:23:05 +0200
committerDecebal Suiu <decebal.suiu@gmail.com>2015-12-24 09:23:05 +0200
commit63b9917619e33bbfe0480f0315acac26d7fea67c (patch)
treeddb7d1e8cd2130d1227984d8be6a76e9e0c60fca /pf4j
parent24dd110c9ef79e2cdbe5112d8d2c6bc7ebc11ca8 (diff)
downloadpf4j-63b9917619e33bbfe0480f0315acac26d7fea67c.tar.gz
pf4j-63b9917619e33bbfe0480f0315acac26d7fea67c.zip
Add constructor with vararg and make addFileFilter method fluent in AndFileFilter
Diffstat (limited to 'pf4j')
-rw-r--r--pf4j/src/main/java/ro/fortsoft/pf4j/util/AndFileFilter.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/util/AndFileFilter.java b/pf4j/src/main/java/ro/fortsoft/pf4j/util/AndFileFilter.java
index 4f7d2c0..b076a69 100644
--- a/pf4j/src/main/java/ro/fortsoft/pf4j/util/AndFileFilter.java
+++ b/pf4j/src/main/java/ro/fortsoft/pf4j/util/AndFileFilter.java
@@ -18,6 +18,7 @@ package ro.fortsoft.pf4j.util;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -37,15 +38,21 @@ public class AndFileFilter implements FileFilter {
private List<FileFilter> fileFilters;
public AndFileFilter() {
- this.fileFilters = new ArrayList<>();
+ this(new ArrayList<FileFilter>());
+ }
+
+ public AndFileFilter(FileFilter... fileFilters) {
+ this(Arrays.asList(fileFilters));
}
public AndFileFilter(List<FileFilter> fileFilters) {
this.fileFilters = new ArrayList<>(fileFilters);
}
- public void addFileFilter(FileFilter fileFilter) {
+ public AndFileFilter addFileFilter(FileFilter fileFilter) {
fileFilters.add(fileFilter);
+
+ return this;
}
public List<FileFilter> getFileFilters() {