use of org.estatio.canonical.communicationchannel.v1.PostalAddressDto in project estatio by estatio.
the class PostalAddressDtoFactory method newDto.
@Programmatic
public PostalAddressDto newDto(final PostalAddress postalAddress) {
PostalAddressDto dto = new PostalAddressDto();
dto.setSelf(mappingHelper.oidDtoFor(postalAddress));
dto.setAddress1(postalAddress.getAddress1());
dto.setAddress2(postalAddress.getAddress2());
dto.setAddress3(postalAddress.getAddress3());
dto.setCity(postalAddress.getCity());
final State postalAddressState = postalAddress.getState();
if (postalAddressState != null) {
dto.setStateReference(postalAddressState.getReference());
dto.setStateName(postalAddressState.getName());
}
final Country postalAddressCountry = postalAddress.getCountry();
if (postalAddressCountry != null) {
dto.setCountryReference(postalAddressCountry.getReference());
dto.setCountryAlpha2Code(postalAddressCountry.getAlpha2Code());
dto.setCountryName(postalAddressCountry.getName());
}
return dto;
}
Aggregations