com.sonalake.utah.config.SearchHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utah-parser Show documentation
Show all versions of utah-parser Show documentation
A Java library for parsing semi-structured text files
The newest version!
package com.sonalake.utah.config;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
/**
* A helper to deal with searches
*/
public class SearchHelper {
/**
* Apply the search translations to the candidate string
*
* @param candidate the candidate
* @param searches
* @return the fully translated text
*/
static String translate(String candidate, List searches) {
String valueText = candidate;
if (null != searches) {
for (NameValue search : searches) {
String formattedId = String.format("{%s}", search.getId());
valueText = StringUtils.replace(valueText, formattedId, search.getValue());
}
}
return valueText;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy