Skip to content

Instantly share code, notes, and snippets.

@SG-K

SG-K/gist5.java Secret

Created July 22, 2020 13:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save SG-K/12f71953ac1c5270c74328b59f260542 to your computer and use it in GitHub Desktop.
public class FilterManager {
public ArrayList<Item> applyFilters(ArrayList<Item> arrayList, Filterable ... filters){
ArrayList<Item> filteredList = new ArrayList<>(arrayList);
for (Filterable f: filters) {
filteredList = f.applyFilter(filteredList);
}
return filteredList;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment