public Collection checkList(List list, String tableColumnName, String agers){ List templist = new ArrayList(); EqualPredicate parameter = new EqualPredicate(agers); BeanPredicate tableCoulmn_paramerter = new BeanPredicate(tableColumnName, parameter); Predicate[] allPredicateArray = {tableCoulmn_paramerter }; Predicate allPredicate = PredicateUtils.allPredicate(allPredicateArray); Collection<MkArea> filteredCollection = org.apache.commons.collections.CollectionUtils.select(list, allPredicate); return filteredCollection; }
import org.apache.commons.collections.PredicateUtils; import org.apache.commons.collections.functors.EqualPredicate;
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Transformer;
import java.util.Collection;
import org.apache.commons.beanutils.BeanPredicate;