Package hudson.model
Interface ItemGroup<T extends Item>
-
- All Superinterfaces:
ModelObject
,PersistenceRoot
,Saveable
- All Known Subinterfaces:
DirectlyModifiableTopLevelItemGroup
,ModifiableItemGroup<T>
,ModifiableTopLevelItemGroup
- All Known Implementing Classes:
AbstractCIBase
,Hudson
,Jenkins
public interface ItemGroup<T extends Item> extends PersistenceRoot, ModelObject
Represents a grouping inherent to a kind ofItem
s.- Author:
- Kohsuke Kawaguchi
- See Also:
ItemGroupMixIn
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Iterable<Item>
allItems()
Gets all the items unordered, lazily and recursively.default <T extends Item>
Iterable<T>allItems(Class<T> type)
default <T extends Item>
Iterable<T>allItems(Class<T> type, Predicate<T> pred)
default List<Item>
getAllItems()
Gets all the items recursively.default <T extends Item>
List<T>getAllItems(Class<T> type)
default <T extends Item>
List<T>getAllItems(Class<T> type, Predicate<T> pred)
Similar togetAllItems(Class)
with additional predicate filteringString
getFullDisplayName()
String
getFullName()
Gets the full name of thisItemGroup
.T
getItem(String name)
Gets theItem
inside this group that has a given name, or null if it does not exist.Collection<T>
getItems()
Gets all the items in this collection in a read-only view.default Collection<T>
getItems(Predicate<T> pred)
Gets all the items in this collection in a read-only view that matches supplied Predicatedefault Stream<T>
getItemsStream()
Gets a read-only stream of all the items in this collectiondefault Stream<T>
getItemsStream(Predicate<T> pred)
Gets a read-only stream of all the items in this collection that matches supplied PredicateFile
getRootDirFor(T child)
Assigns theroot directory
for children.String
getUrl()
Returns the path relative to the context root, like "foo/bar/zot/".String
getUrlChildPrefix()
Gets the URL token that prefixes the URLs for childItem
s.void
onDeleted(T item)
Internal method.default void
onRenamed(T item, String oldName, String newName)
Internal method.-
Methods inherited from interface hudson.model.ModelObject
getDisplayName
-
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
-
-
-
-
Method Detail
-
getFullName
String getFullName()
Gets the full name of thisItemGroup
.- See Also:
Item.getFullName()
-
getFullDisplayName
String getFullDisplayName()
- See Also:
Item.getFullDisplayName()
-
getItems
Collection<T> getItems()
Gets all the items in this collection in a read-only view.
-
getItems
default Collection<T> getItems(Predicate<T> pred)
Gets all the items in this collection in a read-only view that matches supplied Predicate- Since:
- 2.221
-
getItemsStream
default Stream<T> getItemsStream()
Gets a read-only stream of all the items in this collection- Since:
- 2.221
-
getItemsStream
default Stream<T> getItemsStream(Predicate<T> pred)
Gets a read-only stream of all the items in this collection that matches supplied Predicate- Since:
- 2.221
-
getUrl
String getUrl()
Returns the path relative to the context root, like "foo/bar/zot/". Note no leading slash but trailing slash.
-
getUrlChildPrefix
String getUrlChildPrefix()
Gets the URL token that prefixes the URLs for childItem
s. Like "job", "item", etc.
-
getItem
@CheckForNull T getItem(String name) throws org.springframework.security.access.AccessDeniedException
Gets theItem
inside this group that has a given name, or null if it does not exist.- Returns:
- an item whose
Item.getName()
isname
and whoseItem.getParent()
isthis
, or null if there is no such item, or there is but the current user lacks bothItem.DISCOVER
andItem.READ
on it - Throws:
org.springframework.security.access.AccessDeniedException
- if the current user hasItem.DISCOVER
but notItem.READ
on this item
-
getRootDirFor
File getRootDirFor(T child)
Assigns theroot directory
for children.
-
onRenamed
default void onRenamed(T item, String oldName, String newName) throws IOException
Internal method. Called byItem
s when they are renamed by users. This is not expected to callItemListener.onRenamed(hudson.model.Item, java.lang.String, java.lang.String)
, inconsistent withonDeleted(T)
.- Throws:
IOException
-
onDeleted
void onDeleted(T item) throws IOException
Internal method. Called byItem
s when they are deleted by users.- Throws:
IOException
-
getAllItems
default <T extends Item> List<T> getAllItems(Class<T> type, Predicate<T> pred)
Similar togetAllItems(Class)
with additional predicate filtering- Since:
- 2.221
-
allItems
default <T extends Item> Iterable<T> allItems(Class<T> type)
Gets all theItem
s unordered, lazily and recursively in theItemGroup
tree and filter them by the given type.- Since:
- 2.93
-
allItems
default <T extends Item> Iterable<T> allItems(Class<T> type, Predicate<T> pred)
Gets all theItem
s unordered, lazily and recursively in theItemGroup
tree and filter them by the given type and given predicate- Since:
- 2.221
-
-