I have this part of code which I don't understand correctly. I know that it builds a string out of values from the database. I think it's only the title:
private String createSearchFieldContent(Report report) {
return createSearchFieldContent(report.getTitle(), report.getDescription());
}
private String createSearchFieldContent(OverrideableStringValue title,
OverrideableStringValue description) {
StringBuilder builder = new StringBuilder(getValue(title));
if (StringUtils.isNotBlank(getValue(description))) {
builder.append(" ").append(getValue(description));
}
String searchTerm = StringUtils.replaceAll(builder.toString(), "\n", " ");
return unaccent(searchTerm);
}
I have another value which I'd like to add to the searchTerm. It's stored in report.getOwner(). How is it possible that I can build a new searchTerm which includes the title, description and owner?
Thanks!
descriptionif not blank will also be appended. Add a new parameter to your method and follow the same logic as fordescription