2021-12-09 17:54:08 +00:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class Condition {
|
|
|
|
|
2022-01-18 18:49:37 +00:00
|
|
|
List<List<ConditionTest>> conditionsNormaleDisjonctive;
|
2021-12-09 17:54:08 +00:00
|
|
|
|
2022-01-18 18:49:37 +00:00
|
|
|
public Condition(List<List<ConditionTest>> conditions) {
|
|
|
|
this.conditionsNormaleDisjonctive = conditions;
|
2021-12-09 17:54:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public Boolean evaluer() {
|
2022-01-18 18:49:37 +00:00
|
|
|
|
|
|
|
return conditionsNormaleDisjonctive.stream()
|
|
|
|
.anyMatch(
|
|
|
|
conditionOU -> conditionOU.stream()
|
|
|
|
.allMatch(c -> c.evaluer()));
|
2021-12-09 17:54:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|