Search in sources :

Example 16 with ParameterElement

use of org.asqatasun.entity.parameterization.ParameterElement in project Asqatasun by Asqatasun.

the class ParameterDataServiceImpl method getParameterSetFromAuditLevel.

@Override
public Set<Parameter> getParameterSetFromAuditLevel(String ref, String level) {
    if (ref.equalsIgnoreCase(RGAA22_REF) || ref.equalsIgnoreCase(RGAA30_REF) || ref.equalsIgnoreCase(RGAA40_REF)) {
        if (level.equalsIgnoreCase(BRONZE_LEVEL)) {
            level = A_LEVEL;
        } else if (level.equalsIgnoreCase(SILVER_LEVEL)) {
            level = AA_LEVEL;
        } else if (level.equalsIgnoreCase(GOLD_LEVEL)) {
            level = AAA_LEVEL;
        }
    }
    if (level.equalsIgnoreCase(BRONZE_LEVEL) || level.equalsIgnoreCase(A_LEVEL)) {
        level = LEVEL_1;
    } else if (level.equalsIgnoreCase(SILVER_LEVEL) || level.equalsIgnoreCase(AA_LEVEL)) {
        level = LEVEL_2;
    } else if (level.equalsIgnoreCase(GOLD_LEVEL) || level.equalsIgnoreCase(AAA_LEVEL)) {
        level = LEVEL_3;
    }
    ParameterElement levelParameterElement = parameterElementDataService.getParameterElement(LEVEL_PARAMETER_ELEMENT_CODE);
    Parameter levelParameter = getParameter(levelParameterElement, ref + ";" + level);
    Set<Parameter> paramSet = getDefaultParameterSet();
    return updateParameter(paramSet, levelParameter);
}
Also used : Parameter(org.asqatasun.entity.parameterization.Parameter) ParameterElement(org.asqatasun.entity.parameterization.ParameterElement)

Aggregations

ParameterElement (org.asqatasun.entity.parameterization.ParameterElement)16 Parameter (org.asqatasun.entity.parameterization.Parameter)13 ParameterElementImpl (org.asqatasun.entity.parameterization.ParameterElementImpl)5 ParameterImpl (org.asqatasun.entity.parameterization.ParameterImpl)3 HashSet (java.util.HashSet)2 ParameterFamily (org.asqatasun.entity.parameterization.ParameterFamily)2 Test (org.junit.Test)2 NoResultException (javax.persistence.NoResultException)1 NonUniqueResultException (javax.persistence.NonUniqueResultException)1 Query (javax.persistence.Query)1 OptionElement (org.asqatasun.entity.option.OptionElement)1 ParameterFamilyImpl (org.asqatasun.entity.parameterization.ParameterFamilyImpl)1 OptionElement (org.asqatasun.webapp.entity.option.OptionElement)1