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);
}
有四个值,我从 API 中获得,它们不可能作为familyName
. 有没有办法不将它们添加到searchTerm
? 我正在考虑类似的事情StringUtils.contain()
,然后是无效的值......
感谢帮助!