提交 8d7120e2 编写于 作者: K kohsuke

added one more convenience method.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10419 71c3de6d-444a-0410-be80-ed276b4c234a
上级 3f75aaef
......@@ -688,6 +688,17 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node,
return new ArrayList<TopLevelItem>(items.values());
}
/**
* Gets just the immediate children of {@link Hudson} but of the given type.
*/
public <T extends TopLevelItem> List<T> getItems(Class<T> type) {
List<T> r = new ArrayList<T>();
for (TopLevelItem i : items.values())
if (type.isInstance(i))
r.add(type.cast(i));
return r;
}
/**
* Gets all the {@link Item}s recursively in the {@link ItemGroup} tree
* and filter them by the given type.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册