Basic support for using glob pattern in concourse group declarations.
This commit is contained in:
Kris De Volder
2021-05-18 15:07:52 -07:00
parent a485c3247d
commit 6945fe18fc
7 changed files with 328 additions and 4 deletions

View File

@@ -73,13 +73,17 @@ public class EnumValueParser implements ValueParser {
PartialCollection<String> values = this.values.get();
// If values is not fully known then just assume the str is acceptable.
if (values == null || !values.isComplete() || values.getElements().contains(str)) {
if (values == null || !values.isComplete() || hasMatchingValue(str, values.getElements())) {
return str;
} else {
throw errorOnParse(createErrorMessage(str, values.getElements()));
}
}
protected boolean hasMatchingValue(String str, Collection<String> values) {
return values.contains(str);
}
protected String createBlankTextErrorMessage() {
return "'" + typeName + "'" + " cannot be blank.";
}