I have an ArrayList
to be filtered, and various Guava Predicate
s to filter it with. This list will have only 50-100 elements.
I was planning on
I guess you need:
Predicate predicate1 = new Predicate(){
@Override
public boolean apply(XXX input) {
if(...) //satisfy your filter
return true;
else
return false;
}};
Predicate predicate2 = new Predicate(){
@Override
public boolean apply(XXX input) {
if(...) //satisfy your filter
return true;
else
return false;
}};
Predicate allPredicates = Predicates.and(predicate1, predicate2);
//or Predicates.or(predicate1, predicate2);
Collection list2 = Collections2.filter(list, allPredicates);