Search in sources :

Example 1 with AddressDTO

use of gov.ca.cwds.cals.service.dto.AddressDTO in project cals-api by ca-cwds.

the class FacilityAddressMapper method afterMapping.

@AfterMapping
default void afterMapping(@TargetType FacilityAddressDTO facilityAddressDTO, BasePlacementHome placementHome, CwsDictionaryEntriesHolder dictionaryEntriesHolder) {
    AddressMapper addressMapper = Mappers.getMapper(AddressMapper.class);
    AddressDTO addressDTO = null;
    if (RESIDENTIAL.equals(facilityAddressDTO.getType())) {
        addressDTO = addressMapper.toResidentialAddressDTO(placementHome, dictionaryEntriesHolder);
    }
    if (MAIL.equals(facilityAddressDTO.getType())) {
        addressDTO = addressMapper.toMailAddressDTO(placementHome, dictionaryEntriesHolder);
    }
    facilityAddressDTO.setAddress(addressDTO);
}
Also used : FacilityAddressDTO(gov.ca.cwds.cals.service.dto.FacilityAddressDTO) AddressDTO(gov.ca.cwds.cals.service.dto.AddressDTO) AfterMapping(org.mapstruct.AfterMapping)

Aggregations

AddressDTO (gov.ca.cwds.cals.service.dto.AddressDTO)1 FacilityAddressDTO (gov.ca.cwds.cals.service.dto.FacilityAddressDTO)1 AfterMapping (org.mapstruct.AfterMapping)1