/** * Returns <code>true</code> when * <p> * factIdentifier == FactIdentifier.DESCRIPTION * </p><p> * <b>or</b> * <p> * factIdentifier != FactIdentifier.EMPTY * </p><p> * <b>and</b> * </p><p> * factIdentifier != FactIdentifier.INDEX * </p><p> * @param factIdentifier * @return */ protected boolean isInstanceAssigned(FactIdentifier factIdentifier) { if (FactIdentifier.DESCRIPTION.equals(factIdentifier)) { return true; } else { return !(FactIdentifier.EMPTY.equals(factIdentifier) || FactIdentifier.INDEX.equals(factIdentifier)); } }
/** * Dynamically evaluated status to know if the values of the given column are editable or not * @return */ public boolean isReadOnly() { if (FactIdentifier.INDEX.equals(factIdentifier) || FactIdentifier.EMPTY.equals(factIdentifier)) { return true; } if (FactIdentifier.DESCRIPTION.equals(factIdentifier)) { return false; } else { return !isPropertyAssigned(); } }
public List<FactMappingValue> getFactMappingValuesByFactIdentifier(FactIdentifier factIdentifier) { return factMappingValues.stream().filter(e -> e.getFactIdentifier().equals(factIdentifier)).collect(toList()); }
public List<FactMappingValue> getFactMappingValuesByFactIdentifier(FactIdentifier factIdentifier) { return factMappingValues.stream().filter(e -> e.getFactIdentifier().equals(factIdentifier)).collect(toList()); }
public int getIndexByIdentifier(FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier) { return IntStream.range(0, factMappings.size()).filter(index -> { FactMapping factMapping = factMappings.get(index); return factMapping.getExpressionIdentifier().equals(expressionIdentifier) && factMapping.getFactIdentifier().equals(factIdentifier); }).findFirst().orElseThrow(() -> new IllegalArgumentException( new StringBuilder().append("Impossible to find a FactMapping with factIdentifier '").append(factIdentifier.getName()) .append("' and expressionIdentifier '").append(expressionIdentifier.getName()).append("'").toString())); }
public int getIndexByIdentifier(FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier) { return IntStream.range(0, factMappings.size()).filter(index -> { FactMapping factMapping = factMappings.get(index); return factMapping.getExpressionIdentifier().equals(expressionIdentifier) && factMapping.getFactIdentifier().equals(factIdentifier); }).findFirst().orElseThrow(() -> new IllegalArgumentException( new StringBuilder().append("Impossible to find a FactMapping with factIdentifier '").append(factIdentifier.getName()) .append("' and expressionIdentifier '").append(expressionIdentifier.getName()).append("'").toString())); }
public Optional<FactMappingValue> getFactMappingValue(FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier) { return factMappingValues.stream().filter(e -> e.getFactIdentifier().equals(factIdentifier) && e.getExpressionIdentifier().equals(expressionIdentifier)).findFirst(); }
public Optional<FactMappingValue> getFactMappingValue(FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier) { return factMappingValues.stream().filter(e -> e.getFactIdentifier().equals(factIdentifier) && e.getExpressionIdentifier().equals(expressionIdentifier)).findFirst(); }
public String getDescription() { return factMappingValues.stream() .filter(e -> e.getExpressionIdentifier().equals(ExpressionIdentifier.DESCRIPTION) && e.getFactIdentifier().equals(FactIdentifier.DESCRIPTION) && e.getRawValue() != null) .map(e -> (String) e.getRawValue()) .findFirst().orElse(""); }
public String getDescription() { return factMappingValues.stream() .filter(e -> e.getExpressionIdentifier().equals(ExpressionIdentifier.DESCRIPTION) && e.getFactIdentifier().equals(FactIdentifier.DESCRIPTION) && e.getRawValue() != null) .map(e -> (String) e.getRawValue()) .findFirst().orElse(""); }
public Optional<FactMapping> getFactMapping(FactIdentifier factIdentifier, ExpressionIdentifier ei) { List<FactMapping> factMappings = internalFilter(e -> e.getExpressionIdentifier().equals(ei) && e.getFactIdentifier().equals(factIdentifier)); return factMappings.stream().findFirst(); }
public Optional<FactMapping> getFactMapping(FactIdentifier factIdentifier, ExpressionIdentifier ei) { List<FactMapping> factMappings = internalFilter(e -> e.getExpressionIdentifier().equals(ei) && e.getFactIdentifier().equals(factIdentifier)); return factMappings.stream().findFirst(); }
/** * Returns <code>true</code> when * <p> * instanceAssigned == true * </p><p> * <b>and</b> * </p><p> * !factMapping.getExpressionElements().isEmpty() * </p> * @param instanceAssigned * @param factMapping * @return */ protected boolean isPropertyAssigned(boolean instanceAssigned, FactMapping factMapping) { if (FactIdentifier.DESCRIPTION.equals(factMapping.getFactIdentifier())) { return true; } else { return instanceAssigned && (isSimpleJavaType(factMapping.getClassName()) || !factMapping.getExpressionElements().isEmpty()); } }
scenario1Outputs = scenario1Outputs.stream().filter(elem -> elem.getFactIdentifier().equals(input1.getFactIdentifier())).collect(toList()); List<ScenarioResult> scenario1Results = runnerHelper.getScenarioResultsFromGivenFacts(simulation.getSimulationDescriptor(), scenario1Outputs, input1, expressionEvaluator); scenario2Outputs = scenario2Outputs.stream().filter(elem -> elem.getFactIdentifier().equals(input2.getFactIdentifier())).collect(toList()); List<ScenarioResult> scenario2Results = runnerHelper.getScenarioResultsFromGivenFacts(simulation.getSimulationDescriptor(), scenario2Outputs, input2, expressionEvaluator);