class ReportJobConverter implements ToClientConverter<ReportJob, ClientReportJob, Object>, ToServerConverter<ClientReportJob, ReportJob, Object> {

    @Override
    public final ClientReportJob toClient(ReportJob serverObject, Object options) {
        ClientReportJob clientReportJob = new ClientReportJob();
        clientReportJob.setId(serverObject.getId());
        clientReportJob.setVersion(serverObject.getVersion());
        clientReportJob.setUsername(serverObject.getUsername());
        clientReportJob.setLabel(serverObject.getLabel());
        clientReportJob.setDescription(serverObject.getDescription());
        Timestamp creationDate = serverObject.getCreationDate();
        clientReportJob.setCreationDate((creationDate != null) ? new Timestamp(creationDate.getTime()) : null);
        clientReportJob.setBaseOutputFilename(serverObject.getBaseOutputFilename());
        clientReportJob.setOutputLocale(serverObject.getOutputLocale());

        // convert trigger field
        clientReportJob.setTrigger(toClientJobTrigger(serverObject.getTrigger()));

        // convert source field
        try {
            clientReportJob.setSource(toClientJobSource(serverObject.getSource()));
        } catch (ClassCastException e) {
            log.error("Error interpreting parameter " + e.getMessage() +
                    " of job " + serverObject.getLabel() +
                    " of " + serverObject.getSource().getReportUnitURI(), e);
        }

        clientReportJob.setOutputTimeZone(serverObject.getOutputTimeZone());

        // convert destination field
        clientReportJob.setRepositoryDestination(toClientJobRepositoryDestination(serverObject.getContentRepositoryDestination()));

        //convert mail notification
        clientReportJob.setMailNotification(toClientJobMailNotification(serverObject.getMailNotification()));

        // convert alert
        clientReportJob.setAlert(toClientJobAlert(serverObject.getAlert()));

        // convert output formats
        clientReportJob.setOutputFormats(toClientJobOutputFormats(serverObject.getOutputFormatsSet()));

        return clientReportJob;
    }

}