java 根据条件从List中筛选出符合条件的集合


    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;

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM