class SensitivityAnalysisResult {

    public SensitivityValue getSensitivityValue(SensitivityFunction function, SensitivityVariable variable) {
        Optional<SensitivityValue> returnValue = sensitivityValues.stream().filter(sensitivityValue -> sensitivityValue.getFactor().getFunction().equals(function)
                && sensitivityValue.getFactor().getVariable().equals(variable)).findAny();
        if (!returnValue.isPresent()) {
            throw new NoSuchElementException(String.format(VALUE_NOT_FOUND, function.getId(), variable.getId()));
        }
        return returnValue.get();
    }

    @JsonCreator public  SensitivityAnalysisResult(@JsonProperty("ok") boolean ok,
                                     @JsonProperty("metrics") Map<String, String> metrics,
                                     @JsonProperty("logs") String logs,
                                     @JsonProperty("values") List<SensitivityValue> sensitivityValues,
                                     @JsonProperty("contingenciesValues") Map<String, List<SensitivityValue>> sensitivityValuesContingencies);
    public  SensitivityAnalysisResult(boolean ok,
                                     Map<String, String> metrics,
                                     String logs,
                                     List<SensitivityValue> sensitivityValues);

}