Search in sources :

Example 1 with CriterionResult

use of org.asqatasun.webapp.presentation.data.CriterionResult in project Asqatasun by Asqatasun.

the class CriterionResultFactory method getCriterionResult.

/**
     * 
     * @param criterionStatistics
     * @return
     */
public CriterionResult getCriterionResult(CriterionStatistics criterionStatistics) {
    CriterionResult criterionResult = new CriterionResultImpl();
    criterionResult.setCriterion(criterionStatistics.getCriterion());
    criterionResult.setCriterionCode(criterionStatistics.getCriterion().getCode());
    criterionResult.setLevelCode(criterionDataService.getCriterionLevel(criterionStatistics.getCriterion()).getCode());
    criterionResult.setResult(criterionStatistics.getCriterionResult().toString());
    criterionResult.setResultCode(setResultToLowerCase(criterionStatistics.getCriterionResult()));
    return criterionResult;
}
Also used : CriterionResultImpl(org.asqatasun.webapp.presentation.data.CriterionResultImpl) CriterionResult(org.asqatasun.webapp.presentation.data.CriterionResult)

Example 2 with CriterionResult

use of org.asqatasun.webapp.presentation.data.CriterionResult in project Asqatasun by Asqatasun.

the class CriterionResultFactory method prepareThemeResultMap.

/**
     * 
     * @param netResultList
     * @return
     */
private Map<Theme, List<CriterionResult>> prepareThemeResultMap(List<CriterionStatistics> criterionStatList) {
    // Map that associates a list of results with a theme
    Map<Theme, List<CriterionResult>> criterionResultMap = new LinkedHashMap<Theme, List<CriterionResult>>();
    sortCollection(criterionStatList);
    for (CriterionStatistics crs : criterionStatList) {
        CriterionResult testResult = getCriterionResult(crs);
        Theme theme = crs.getCriterion().getTheme();
        if (criterionResultMap.containsKey(theme)) {
            criterionResultMap.get(theme).add(testResult);
        } else {
            List<CriterionResult> criterionResultList = new ArrayList<CriterionResult>();
            criterionResultList.add(testResult);
            criterionResultMap.put(theme, criterionResultList);
        }
    }
    return criterionResultMap;
}
Also used : Theme(org.asqatasun.entity.reference.Theme) CriterionStatistics(org.asqatasun.entity.statistics.CriterionStatistics) CriterionResult(org.asqatasun.webapp.presentation.data.CriterionResult)

Aggregations

CriterionResult (org.asqatasun.webapp.presentation.data.CriterionResult)2 Theme (org.asqatasun.entity.reference.Theme)1 CriterionStatistics (org.asqatasun.entity.statistics.CriterionStatistics)1 CriterionResultImpl (org.asqatasun.webapp.presentation.data.CriterionResultImpl)1