Search in sources :

Example 1 with PostalAddressDto

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;
}
Also used : PostalAddressDto(org.estatio.canonical.communicationchannel.v1.PostalAddressDto) State(org.incode.module.country.dom.impl.State) Country(org.incode.module.country.dom.impl.Country) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Aggregations

Programmatic (org.apache.isis.applib.annotation.Programmatic)1 PostalAddressDto (org.estatio.canonical.communicationchannel.v1.PostalAddressDto)1 Country (org.incode.module.country.dom.impl.Country)1 State (org.incode.module.country.dom.impl.State)1