/** * Collect all confidences having a specific type * @param confs * @param typeId * @param typeName * @return */ public static Collection<Confidence> collectAllConfidencesHavingType(Collection<? extends Confidence> confs, String typeId, String typeName){ if (confs == null || confs.isEmpty()){ return Collections.EMPTY_LIST; } Collection<Confidence> confidences = new ArrayList<Confidence>(confs.size()); for (Confidence conf : confs){ if (doesConfidenceHaveType(conf, typeId, typeName)){ confidences.add(conf); } } return confidences; }
final Collection<Confidence> confs = ConfidenceUtils.collectAllConfidencesHavingType(interaction.getConfidences(), Confidence.AUTHOR_BASED_CONFIDENCE_MI, "author score");