Assert.notEmpty(els, "Can not find config elements with id: " + id);
return getConfig(els);
}
private ConfigElement getConfig(List<ConfigElement> els) {
ConfigElement result = null;
for (ConfigElement element : els) {
if (result == null) {
boolean applies = evaluator.applies(element.getCondition());
if (applies) {
result = element;
}
} else {
boolean applies = evaluator.applies(element.getCondition());
if (applies) {
if (!element.isReplace()) {
result = result.combine(element);
} else {
result = element;
}
}
}
}
return result.createCopy();
}