private String createSearchFieldContent(OverrideableStringValue title,
OverrideableContactValue owner) {
StringBuilder builder = new StringBuilder(getValue(title));
if (StringUtils.isNotBlank(getValue(owner).getFamilyName())) {
builder.append(" ").append(getValue(owner).getFamilyName());
}
String searchTerm = StringUtils.replaceAll(builder.toString(), "\n", " ");
return unaccent(searchTerm);
}
There are four values, which I get from an API and they are not possible as familyName
. Is there a way to don't add them to the searchTerm
? I'm thinking about something like StringUtils.contain()
and then there the invalid values...
Thanks for help!