public static String getClosest(Locale locale, OrganisaatioDTO org) { String lang = locale != null && locale.getLanguage() != null ? locale.getLanguage().toLowerCase() : ""; if (org.getNimi() == null) { return ""; } for (Teksti curTeksti : org.getNimi().getTeksti()) { if (curTeksti.getKieliKoodi().equals(lang)) { return curTeksti.getValue(); } } return getAvailableName(org); }
public static String getYttCaption(Locale locale, YhteystietojenTyyppiDTO ytt) { String lang = locale.getLanguage().toLowerCase(); if (ytt.getNimi() == null) { return ""; } for (Teksti curTeksti : ytt.getNimi().getTeksti()) { if (curTeksti.getKieliKoodi().equals(lang)) {//getNimiFi() != null) { return curTeksti.getValue(); } } return getAvailableYttName(ytt); }