org.apache.commons.collections.CollectionUtils.filter

org.apache.commons.collections.CollectionUtils.filter(subData, new FilterPredicate("CLIENT"));   
  
class FilterPredicate implements Predicate{   
    private String accAttribute;   
    public TestPredicate(String accountAttribute){   
        this.accAttribute = accountAttribute;   
    }   
public boolean evaluate(Object arg0) {   
    if (arg0 instanceof IssuerPlacingAndCommissionFeeReportByAc) {   
        return accAttribute.equals(((IssuerPlacingAndCommissionFeeReportByAc) arg0).getAccountAttribute());   
    }   
    return false;   
}   
  } 

    按照自己的evaluate方法来加于过滤collection.

你可能感兴趣的:(apache)