diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index cffc998c29..279175deda 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -688,6 +688,17 @@ public final class Hudson extends View implements ItemGroup, Node, return new ArrayList(items.values()); } + /** + * Gets just the immediate children of {@link Hudson} but of the given type. + */ + public List getItems(Class type) { + List r = new ArrayList(); + 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.