@Test public void voteMatch_match_diff_only_filtered_chars() { affiliation.setOrganizationName("mickey mouse's, ice creams"); resetOrgNames("mickey mouse's ice creams"); when(stringFilter.filterChars("mickey mouse's, ice creams", ImmutableList.of(','))).thenReturn("mickey mouse's ice creams"); when(stringFilter.filterChars("mickey mouse's ice creams", ImmutableList.of(','))).thenReturn("mickey mouse's ice creams"); assertTrue(voter.voteMatch(affiliation, organization)); }
@Override public boolean voteMatch(AffMatchAffiliation affiliation, AffMatchOrganization organization) { String filteredAffName = stringFilter.filterChars(affiliation.getOrganizationName(), charsToFilter); if (StringUtils.isEmpty(filteredAffName)) { return false; } for (String orgName : getOrgNamesFunction.apply(organization)) { String filteredOrgName = stringFilter.filterChars(orgName, charsToFilter); if (StringUtils.isEmpty(filteredOrgName)) { continue; } if (filteredAffName.equals(filteredOrgName)) { return true; } } return false; }
NameStrictWithCharFilteringMatchVoter extends AbstractAffOrgMatchVoter { @Override public boolean voteMatch(AffMatchAffiliation affiliation, AffMatchOrganization organization) { String filteredAffName = stringFilter.filterChars(affiliation.getOrganizationName(), charsToFilter); if (StringUtils.isEmpty(filteredAffName)) { return false; } for (String orgName : getOrgNamesFunction.apply(organization)) { String filteredOrgName = stringFilter.filterChars(orgName, charsToFilter); if (StringUtils.isEmpty(filteredOrgName)) { continue; } if (filteredAffName.equals(filteredOrgName)) { return true; } } return false; } }
NameStrictWithCharFilteringMatchVoter extends AbstractAffOrgMatchVoter { @Override public boolean voteMatch(AffMatchAffiliation affiliation, AffMatchOrganization organization) { String filteredAffName = stringFilter.filterChars(affiliation.getOrganizationName(), charsToFilter); if (StringUtils.isEmpty(filteredAffName)) { return false; } for (String orgName : getOrgNamesFunction.apply(organization)) { String filteredOrgName = stringFilter.filterChars(orgName, charsToFilter); if (StringUtils.isEmpty(filteredOrgName)) { continue; } if (filteredAffName.equals(filteredOrgName)) { return true; } } return false; } NameStrictWithCharFilteringMatchVoter(List<Character> charsToFilter); }
NameStrictWithCharFilteringMatchVoter extends AbstractAffOrgMatchVoter { @Override public boolean voteMatch(AffMatchAffiliation affiliation, AffMatchOrganization organization) { String filteredAffName = stringFilter.filterChars(affiliation.getOrganizationName(), charsToFilter); if (StringUtils.isEmpty(filteredAffName)) { return false; } for (String orgName : getOrgNamesFunction.apply(organization)) { String filteredOrgName = stringFilter.filterChars(orgName, charsToFilter); if (StringUtils.isEmpty(filteredOrgName)) { continue; } if (filteredAffName.equals(filteredOrgName)) { return true; } } return false; } NameStrictWithCharFilteringMatchVoter(List<Character> charsToFilter); @Override boolean voteMatch(AffMatchAffiliation affiliation, AffMatchOrganization organization); void setGetOrgNamesFunction(Function<AffMatchOrganization, List<String>> getOrgNamesFunction); @Override String toString(); }
NameStrictWithCharFilteringMatchVoter extends AbstractAffOrgMatchVoter { @Override public boolean voteMatch(AffMatchAffiliation affiliation, AffMatchOrganization organization) { String filteredAffName = stringFilter.filterChars(affiliation.getOrganizationName(), charsToFilter); if (StringUtils.isEmpty(filteredAffName)) { return false; } for (String orgName : getOrgNamesFunction.apply(organization)) { String filteredOrgName = stringFilter.filterChars(orgName, charsToFilter); if (StringUtils.isEmpty(filteredOrgName)) { continue; } if (filteredAffName.equals(filteredOrgName)) { return true; } } return false; } NameStrictWithCharFilteringMatchVoter(List<Character> charsToFilter); @Override boolean voteMatch(AffMatchAffiliation affiliation, AffMatchOrganization organization); void setGetOrgNamesFunction(Function<AffMatchOrganization, List<String>> getOrgNamesFunction); @Override String toString();  }