Make SubmitRule#evaluate return an Optional instead of a Collection
The original specification used a Collection so that a single SubmitRule can return multiple SubmitRecords. The main use-case was inheritance and being open to more future usages. Looking at this today, this seems strange because a SubmitRecord keeps a list of SubmitRequirements, so even if it is not allowed to return a Collection, it can still contribute a number of SubmitRecords. This does invalidate the original reasoning from using a Collection which is why this commit replaces it with an Optional. Change-Id: I0dce438504b30fe102f5b83af9f7976659f1fae8
This commit is contained in:
@@ -547,7 +547,7 @@ class RevisionApiImpl implements RevisionApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TestSubmitRuleInfo> testSubmitRule(TestSubmitRuleInput in) throws RestApiException {
|
||||
public TestSubmitRuleInfo testSubmitRule(TestSubmitRuleInput in) throws RestApiException {
|
||||
try {
|
||||
return testSubmitRule.get().apply(revision, in).value();
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user