org.apache.commons.collections4.CollectionUtils.countMatches()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.apache.commons.collections4.CollectionUtils.countMatches()方法的一些代码示例,展示了CollectionUtils.countMatches()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CollectionUtils.countMatches()方法的具体详情如下:
包路径:org.apache.commons.collections4.CollectionUtils
类名称:CollectionUtils
方法名:countMatches

CollectionUtils.countMatches介绍

[英]Counts the number of elements in the input collection that match the predicate.

A null collection or predicate matches no elements.
[中]统计输入集合中与谓词匹配的元素数。
null集合或谓词不匹配任何元素。

代码示例

代码示例来源:origin: opencast/opencast

/**
 * @see org.opencastproject.serviceregistry.impl.jmx.ServicesStatisticsMXBean#getWarningServiceCount()
 */
@Override
public int getWarningServiceCount() {
 return CollectionUtils.countMatches(services.values(), PredicateUtils.equalPredicate(ServiceState.WARNING));
}

代码示例来源:origin: opencast/opencast

/**
 * @see org.opencastproject.serviceregistry.impl.jmx.HostsStatisticsMXBean#getOnlineCount()
 */
@Override
public int getOnlineCount() {
 return CollectionUtils.countMatches(hosts.values(), PredicateUtils.equalPredicate(ONLINE));
}

代码示例来源:origin: opencast/opencast

/**
 * @see org.opencastproject.serviceregistry.impl.jmx.HostsStatisticsMXBean#getOfflineCount()
 */
@Override
public int getOfflineCount() {
 return CollectionUtils.countMatches(hosts.values(), PredicateUtils.equalPredicate(OFFLINE));
}

代码示例来源:origin: opencast/opencast

/**
 * @see org.opencastproject.serviceregistry.impl.jmx.ServicesStatisticsMXBean#getNormalServiceCount()
 */
@Override
public int getNormalServiceCount() {
 return CollectionUtils.countMatches(services.values(), PredicateUtils.equalPredicate(ServiceState.NORMAL));
}

代码示例来源:origin: opencast/opencast

/**
 * @see org.opencastproject.serviceregistry.impl.jmx.HostsStatisticsMXBean#getInMaintenanceCount()
 */
@Override
public int getInMaintenanceCount() {
 return CollectionUtils.countMatches(hosts.values(), PredicateUtils.equalPredicate(MAINTENANCE));
}

代码示例来源:origin: opencast/opencast

/**
 * @see org.opencastproject.serviceregistry.impl.jmx.ServicesStatisticsMXBean#getErrorServiceCount()
 */
@Override
public int getErrorServiceCount() {
 return CollectionUtils.countMatches(services.values(), PredicateUtils.equalPredicate(ServiceState.ERROR));
}

代码示例来源:origin: com.github.rvesse/airline

private <T> boolean isApplicableToOption(ParseState<T> state, OptionMetadata option) {
  int index = CollectionUtils.countMatches(state.getParsedOptions(), new ParsedOptionFinder(option))
      % option.getArity();
  return indices.contains(index);
}

代码示例来源:origin: NationalSecurityAgency/datawave

int count = CollectionUtils.countMatches(
        queryLogics,
        object -> {

相关文章