use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.NamePrefixType in project cals-api by ca-cwds.
the class OtherAdultsInPlacementHomeMapper method afterMapping.
@AfterMapping
default void afterMapping(@MappingTarget OtherAdultsInPlacementHome target, OtherAdultDTO otherAdultDTO) {
StringBuilder nameBuilder = new StringBuilder();
NamePrefixType namePrefix = otherAdultDTO.getNamePrefix();
if (namePrefix != null) {
nameBuilder.append(namePrefix.getValue());
}
String firstName = otherAdultDTO.getFirstName();
if (StringUtils.isNoneEmpty(firstName)) {
nameBuilder.append(' ').append(firstName);
}
String middleName = otherAdultDTO.getMiddleName();
if (StringUtils.isNoneEmpty(middleName)) {
nameBuilder.append(' ').append(middleName);
}
String lastName = otherAdultDTO.getLastName();
if (StringUtils.isNoneEmpty(lastName)) {
nameBuilder.append(' ').append(lastName);
}
NameSuffixType nameSuffix = otherAdultDTO.getNameSuffix();
if (nameSuffix != null) {
nameBuilder.append(' ').append(nameSuffix.getValue());
}
target.setOthAdltnm(nameBuilder.toString());
}
Aggregations