public void foreach(final Consumer<Issue> sink) { final DatabaseIssuesIterator iterator = new DatabaseIssuesIterator(delegator, issueFactory); try { CollectionUtil.foreach(iterator, sink); } finally { iterator.close(); } }
public void foreach(final Consumer<Issue> sink) { CollectionUtil.foreach( new AbstractTransformIssueIterator<Long>(ids) { @Override protected Issue transform(final Long o) { return issueManager.getIssueObject(o); } }, sink); }
public static List<Class<?>> collectCaseClasses(TestSuite suite) { return filterDuplicates( CollectionUtil.transform( collectCases(suite), new Function<Test, Class<?>>() { @Override public Class<?> get(Test input) { return input.getClass(); } })); }
public List<String> getIdsFromName(final String name) { notNull("name", name); Collection<Version> versions = versionManager.getVersionsByName(name); Function<Version, String> function = new Function<Version, String>() { public String get(final Version input) { return input.getId().toString(); } }; return CollectionUtil.transform(versions, function); }
/** * Returns all currently matchign temporary attachments for a particular issue. If a null issue id * is provided, this should be interpreted as a newly created issue that doesn't have an id yet. * * @param issueId The id of the issue to get attachmetns for. May be null * @return a collection of temporary attachments for this issue sorted by creation date */ public Collection<TemporaryAttachment> getByIssueId(final Long issueId) { final ArrayList<TemporaryAttachment> ret = new ArrayList<TemporaryAttachment>( CollectionUtil.filter( temporaryAttachments.values(), new Predicate<TemporaryAttachment>() { public boolean evaluate(final TemporaryAttachment input) { return issueId == null && input.getIssueId() == null || (issueId != null && issueId.equals(input.getIssueId())); } })); Collections.sort(ret); return ret; }
public static List<String> collectCaseNames(TestSuite suite) { return filterDuplicates( CollectionUtil.transform( collectCases(suite), new Function<Test, String>() { @Override public String get(Test input) { if (input instanceof TestCase) { return ((TestCase) input).getName(); } return ""; } })); }