Package jenkins.model
Interface DirectlyModifiableTopLevelItemGroup
- All Superinterfaces:
FullyNamed,FullyNamedModelObject,ItemGroup<TopLevelItem>,ModelObject,ModifiableItemGroup<TopLevelItem>,ModifiableTopLevelItemGroup,PersistenceRoot,Saveable
Item group which supports items being directly moved in or out of it.
- Since:
- 1.548
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription<I extends TopLevelItem>
IAdds an item to this group.booleancanAdd(TopLevelItem item) Returns true if a particular item may be added to this group.voidremove(TopLevelItem item) Removes an item from this group.Methods inherited from interface jenkins.model.FullyNamed
getFullNameMethods inherited from interface jenkins.model.FullyNamedModelObject
getFullDisplayNameMethods inherited from interface hudson.model.ItemGroup
allItems, allItems, allItems, getAllItems, getAllItems, getAllItems, getItem, getItemName, getItems, getItems, getItemsStream, getItemsStream, getRootDirFor, getUrl, getUrlChildPrefix, onDeleted, onRenamedMethods inherited from interface hudson.model.ModelObject
getDisplayNameMethods inherited from interface hudson.model.ModifiableItemGroup
doCreateItem, doCreateItemMethods inherited from interface jenkins.model.ModifiableTopLevelItemGroup
copy, createProject, createProjectFromXMLMethods inherited from interface hudson.model.PersistenceRoot
getRootDir
-
Method Details
-
canAdd
Returns true if a particular item may be added to this group.- Parameters:
item- an item currently elsewhere- Returns:
- true if
add(I, java.lang.String)may be called with this item
-
add
Adds an item to this group. UnlikeJenkins.putItem(hudson.model.TopLevelItem)this does not try to callItem.delete()on an existing item, nor does it fireItemListener.onCreated(hudson.model.Item), nor check permissions. Normally you would callItem.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)after calling this method (the implementation is not expected to do so).- Type Parameters:
I- the kind of item- Parameters:
item- an item to add which is currently elsewherename- the desired item name in this group (might simply be the originalItem.getName())- Returns:
- normally the same
item, but might be a new copy if necessary - Throws:
IOException- if adding failsIllegalArgumentException- ifcanAdd(hudson.model.TopLevelItem)is false, or an item with this name already exists, or this item is as yet unnamed
-
remove
Removes an item from this group. UnlikeItemGroup.onDeleted(T)this is not expected to fire any events.- Parameters:
item- an item which was part of this group- Throws:
IOException- if removing failsIllegalArgumentException- if this was not part of the group to begin with
-