Commit 847e41d0 authored by Thomas Huster's avatar Thomas Huster

[17711] added method to get salutation string for person based on gender

parent 0dc66910
Pipeline #12572 passed with stages
in 5 minutes
......@@ -39,15 +39,7 @@ public class AddressFormatUtil {
public static String getSingleLine(IPerson person){
StringBuilder ret = new StringBuilder();
String salutation;
if (person.getGender().equals(Gender.MALE)) {
salutation = Messages.KontakteView_SalutationM;
} else if (person.getGender().equals(Gender.FEMALE)) {
salutation = Messages.KontakteView_SalutationF;
} else {
salutation = ""; //$NON-NLS-1$
}
ret.append(salutation);
ret.append(PersonFormatUtil.getSalutation(person));
ret.append(StringTool.space);
// name with title
......
......@@ -5,6 +5,7 @@ import java.time.format.DateTimeFormatter;
import org.apache.commons.lang3.StringUtils;
import ch.elexis.core.l10n.Messages;
import ch.elexis.core.model.IPerson;
import ch.elexis.core.types.Gender;
......@@ -80,4 +81,14 @@ public class PersonFormatUtil {
}
return sb.toString();
}
public static String getSalutation(IPerson person){
if (person.getGender().equals(Gender.MALE)) {
return Messages.KontakteView_SalutationM;
} else if (person.getGender().equals(Gender.FEMALE)) {
return Messages.KontakteView_SalutationF;
} else {
return ""; //$NON-NLS-1$
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment