List of usage examples for org.apache.commons.collections.functors InstanceofPredicate getInstance
public static Predicate getInstance(Class type)
From source file:com.tacitknowledge.flip.AbstractFeatureServiceFactory.java
/** * Determines whether provided <code>list</code> contains item * of a given type <code>klass</code> * // w ww. j av a 2 s . c om * @param list {@link List} to process * @param klass item type to look for * @return <code>true</code> in case there is an existent item of a given type within * provided list, <code>false</code> - otherwise */ protected boolean isListHasItemOfType(final List<?> list, final Class<?> klass) { return CollectionUtils.exists(list, InstanceofPredicate.getInstance(klass)); }
From source file:org.sipfoundry.sipxconfig.admin.dialplan.DialPlan.java
/** * This function return all attendant rules contained in this plan. * * @return list of attendant rules, empty list if no attendant rules in this plan *//* w ww.j a v a2 s. c o m*/ public List<AttendantRule> getAttendantRules() { List<AttendantRule> attendantRules = new ArrayList<AttendantRule>(); Predicate isAttendantRule = InstanceofPredicate.getInstance(AttendantRule.class); CollectionUtils.select(m_rules, isAttendantRule, attendantRules); return attendantRules; }