NdsBeisEsb/src/main/java/com/northgateps/nds/beis/esb/converter/ToRegisterPRSExemptionRequestConverter.java
/**
     * Convert the passed in RegisterPrsExemptionNdsRequest to the passed out RegisterPRSExemptionRequest
     * 
     * @param class RegisterPrsExemptionNdsRequest
     * @return RegisterPRSExemptionRequest
     */
Convert the passed in RegisterPrsExemptionNdsRequest to the passed out RegisterPRSExemptionRequest


Convert the passed in RegisterPrsExemptionNdsRequest to the passed out RegisterPRSExemptionRequest
@Converter
    public RegisterPRSExemptionRequest converting(RegisterPrsExemptionNdsRequest registerPrsExemptionNdsRequest)
            throws DatatypeConfigurationException {
        logger.info("Conversion of Nds request object into back office request object started.");
        /* Class being converted to */
        RegisterPRSExemptionRequest registerPRSExemptionRequest = new RegisterPRSExemptionRequest();
        ExemptionDetail exemptionDetails = null;
        if (registerPrsExemptionNdsRequest != null) {
            exemptionDetails = registerPrsExemptionNdsRequest.getRegisterPrsExemptionDetails().getExemptionDetails();
        }
        if (exemptionDetails != null) {
            registerPRSExemptionRequest.setExemptionReference(exemptionDetails.getReferenceId());
            if (exemptionDetails.getPropertyType() != null) {
                registerPRSExemptionRequest.setService(exemptionDetails.getPropertyType().name());
            }
            if (exemptionDetails.getLandlordDetails() != null) {
                setLandlordDetails(registerPRSExemptionRequest, registerPrsExemptionNdsRequest);
            } else {
                registerPRSExemptionRequest.setLandlordPartyRef(
                        new BigInteger(registerPrsExemptionNdsRequest.getAccountId()));
            }
            if (exemptionDetails.getEpc() != null) {
                setPropertyAddress(registerPRSExemptionRequest, exemptionDetails);
            }
            registerPRSExemptionRequest.setExemptionCode(exemptionDetails.getExemptionType());
            registerPRSExemptionRequest.setExemptionOptionCode(exemptionDetails.getExemptionReason());
            registerPRSExemptionRequest.setExemptionText(exemptionDetails.getExemptionText());
            registerPRSExemptionRequest.setExemptionStartDate(
                    ZonedDateTimeToXMLGregorianCalendarConverter.convert(exemptionDetails.getExemptionStartDate()));
            registerPRSExemptionRequest.setExemptionOptionText(exemptionDetails.getExemptionReasonAdditionalText());
            registerPRSExemptionRequest.setExemptionConfirmation(exemptionDetails.getExemptionConfirmationText());
            registerPRSExemptionRequest.setExemptionConfirmationInd(exemptionDetails.getExemptionConfirmationIndicator());
            ExemptionDocumentType exemptionDocumentType = new ExemptionDocumentType();
            if (exemptionDetails.getEpcEvidenceFiles() != null) {
                setEpcDetails(exemptionDocumentType, exemptionDetails);
            }
            if (exemptionDetails.getEpc() != null) {
                addExemptionDocuments(exemptionDocumentType, exemptionDetails);
            }
            if (exemptionDetails.getExemptionTextFile() != null) {
                getExemptionTextFiles(exemptionDocumentType, exemptionDetails);
                registerPRSExemptionRequest.setExemptionDocuments(exemptionDocumentType);
            }
        }
        logger.info("Conversion of Nds request object into back office request object completed.");
        return registerPRSExemptionRequest;
    }
@ Converter public RegisterPRSExemptionRequest converting ( RegisterPrsExemptionNdsRequest registerPrsExemptionNdsRequest ) throws DatatypeConfigurationException { logger . info ( "Conversion of Nds request object into back office request object started." ) ; /* Class being converted to */ RegisterPRSExemptionRequest registerPRSExemptionRequest = new RegisterPRSExemptionRequest ( ) ; ExemptionDetail exemptionDetails = null ; if ( registerPrsExemptionNdsRequest != null ) { exemptionDetails = registerPrsExemptionNdsRequest . getRegisterPrsExemptionDetails ( ) . getExemptionDetails ( ) ; } if ( exemptionDetails != null ) { registerPRSExemptionRequest . setExemptionReference ( exemptionDetails . getReferenceId ( ) ) ; if ( exemptionDetails . getPropertyType ( ) != null ) { registerPRSExemptionRequest . setService ( exemptionDetails . getPropertyType ( ) . name ( ) ) ; } if ( exemptionDetails . getLandlordDetails ( ) != null ) { setLandlordDetails ( registerPRSExemptionRequest , registerPrsExemptionNdsRequest ) ; } else { registerPRSExemptionRequest . setLandlordPartyRef ( new BigInteger ( registerPrsExemptionNdsRequest . getAccountId ( ) ) ) ; } if ( exemptionDetails . getEpc ( ) != null ) { setPropertyAddress ( registerPRSExemptionRequest , exemptionDetails ) ; } registerPRSExemptionRequest . setExemptionCode ( exemptionDetails . getExemptionType ( ) ) ; registerPRSExemptionRequest . setExemptionOptionCode ( exemptionDetails . getExemptionReason ( ) ) ; registerPRSExemptionRequest . setExemptionText ( exemptionDetails . getExemptionText ( ) ) ; registerPRSExemptionRequest . setExemptionStartDate ( ZonedDateTimeToXMLGregorianCalendarConverter . convert ( exemptionDetails . getExemptionStartDate ( ) ) ) ; registerPRSExemptionRequest . setExemptionOptionText ( exemptionDetails . getExemptionReasonAdditionalText ( ) ) ; registerPRSExemptionRequest . setExemptionConfirmation ( exemptionDetails . getExemptionConfirmationText ( ) ) ; registerPRSExemptionRequest . setExemptionConfirmationInd ( exemptionDetails . getExemptionConfirmationIndicator ( ) ) ; ExemptionDocumentType exemptionDocumentType = new ExemptionDocumentType ( ) ; if ( exemptionDetails . getEpcEvidenceFiles ( ) != null ) { setEpcDetails ( exemptionDocumentType , exemptionDetails ) ; } if ( exemptionDetails . getEpc ( ) != null ) { addExemptionDocuments ( exemptionDocumentType , exemptionDetails ) ; } if ( exemptionDetails . getExemptionTextFile ( ) != null ) { getExemptionTextFiles ( exemptionDocumentType , exemptionDetails ) ; registerPRSExemptionRequest . setExemptionDocuments ( exemptionDocumentType ) ; } } logger . info ( "Conversion of Nds request object into back office request object completed." ) ; return registerPRSExemptionRequest ; }
Convert the passed in RegisterPrsExemptionNdsRequest to the passed out RegisterPRSExemptionRequest
Convert the passed in RegisterPrsExemptionNdsRequest to the passed out RegisterPRSExemptionRequest