class GlobalConfDiagnosticConverter {

    public GlobalConfDiagnostics convert(DiagnosticsStatus diagnosticsStatus) {
        GlobalConfDiagnostics globalConfDiagnostics = new GlobalConfDiagnostics();
        Optional<ConfigurationStatus> statusCode = ConfigurationStatusMapping.map(
                diagnosticsStatus.getReturnCode());
        globalConfDiagnostics.setStatusCode(statusCode.orElse(null));
        Optional<DiagnosticStatusClass> statusClass = DiagnosticStatusClassMapping.map(
                diagnosticsStatus.getReturnCode());
        globalConfDiagnostics.setStatusClass(statusClass.orElse(null));
        globalConfDiagnostics.setPrevUpdateAt(diagnosticsStatus.getPrevUpdate());
        globalConfDiagnostics.setNextUpdateAt(diagnosticsStatus.getNextUpdate());

        return globalConfDiagnostics;
    }

}