NdsBeisEsb/src/main/java/com/northgateps/nds/beis/esb/converter/ToUpdateEmailNdsRequestConverter.java
/**
     * @param request This is the shared UI request object for changes to a user's account.
     * @return - the the standard platform UpdateEmailNdsRequest.
     */
@param request This is the shared UI request object for changes to a user's account.
@return - the the standard platform UpdateEmailNdsRequest.
@param request This is the shared UI request object for changes to a user ' s account . @return - the the standard platform UpdateEmailNdsRequest .
@Converter
    public static UpdateEmailNdsRequest converting(SaveRegisteredAccountDetailsNdsRequest request)
            throws NdsBusinessException {
        UpdateEmailNdsRequest to = new UpdateEmailNdsRequest();
        BeisUpdateUserDetails from = null;
        if (request.getRegisteredAccountDetails() != null) {
            from = request.getRegisteredAccountDetails().getUpdateUserDetails();
        }
        if (from == null) {
            throw new NdsBusinessException("Error occurred. There are no updated user details to save.");
        }
        UpdateEmailDetails updateEmailDetails = new UpdateEmailDetails();
        updateEmailDetails.setUserName(from.getUsername());
        updateEmailDetails.setEmail(from.getEmail());
        updateEmailDetails.setConfirmEmail(from.getEmail());
        updateEmailDetails.setPassword(from.getPassword());
        updateEmailDetails.setTenant(request.getTenant());
        to.setUpdateEmailDetails(updateEmailDetails);
        to.setPublicWebAddress(request.getPublicWebAddress());
        to.setEmailTemplateName(request.getEmailTemplateName());
        return to;
    }
@ Converter public static UpdateEmailNdsRequest converting ( SaveRegisteredAccountDetailsNdsRequest request ) throws NdsBusinessException { UpdateEmailNdsRequest to = new UpdateEmailNdsRequest ( ) ; BeisUpdateUserDetails from = null ; if ( request . getRegisteredAccountDetails ( ) != null ) { from = request . getRegisteredAccountDetails ( ) . getUpdateUserDetails ( ) ; } if ( from == null ) { throw new NdsBusinessException ( "Error occurred. There are no updated user details to save." ) ; } UpdateEmailDetails updateEmailDetails = new UpdateEmailDetails ( ) ; updateEmailDetails . setUserName ( from . getUsername ( ) ) ; updateEmailDetails . setEmail ( from . getEmail ( ) ) ; updateEmailDetails . setConfirmEmail ( from . getEmail ( ) ) ; updateEmailDetails . setPassword ( from . getPassword ( ) ) ; updateEmailDetails . setTenant ( request . getTenant ( ) ) ; to . setUpdateEmailDetails ( updateEmailDetails ) ; to . setPublicWebAddress ( request . getPublicWebAddress ( ) ) ; to . setEmailTemplateName ( request . getEmailTemplateName ( ) ) ; return to ; }
@param request This is the shared UI request object for changes to a user's account.
@param request This is the shared UI request object for changes to a user ' s account .