class ReportParametersHelper {

    public static List<ReportParameter> fromRawParameters(Map<String, String[]> reportParams) {
        List<ReportParameter> reportParameterList = null;
        if (reportParams != null && reportParams.size() > 0) {
            reportParameterList = new ArrayList<ReportParameter>();
            for (String key : reportParams.keySet()) {
                ReportParameter reportParameter = new ReportParameter();
                reportParameter.setName(key);
                if (reportParams.get(key) != null) {
                    reportParameter.setValues(Arrays.asList(reportParams.get(key)));
                }
                reportParameterList.add(reportParameter);
            }
        }
        return reportParameterList;
    }

}