InternalChangeQuery: Add byLegacyChangeIds method

Useful for plugins that want to batch look up changes.

Change-Id: I5f03d65af0945a94adb1ab8e5c6a775744f89b93
This commit is contained in:
Dave Borowitz
2016-02-10 15:23:01 -05:00
parent 34423241d5
commit 669524de5d

View File

@@ -122,6 +122,15 @@ public class InternalChangeQuery {
return query(new LegacyChangeIdPredicate(id));
}
public List<ChangeData> byLegacyChangeIds(Collection<Change.Id> ids)
throws OrmException {
List<Predicate<ChangeData>> preds = new ArrayList<>(ids.size());
for (Change.Id id : ids) {
preds.add(new LegacyChangeIdPredicate(id));
}
return query(or(preds));
}
public List<ChangeData> byBranchKey(Branch.NameKey branch, Change.Key key)
throws OrmException {
return query(and(