Package jenkins.model
Interface DirectlyModifiableTopLevelItemGroup
- All Superinterfaces:
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.boolean
canAdd
(TopLevelItem item) Returns true if a particular item may be added to this group.void
remove
(TopLevelItem item) Removes an item from this group.Methods inherited from interface hudson.model.ItemGroup
allItems, allItems, allItems, getAllItems, getAllItems, getAllItems, getFullDisplayName, getFullName, getItem, getItemName, getItems, getItems, getItemsStream, getItemsStream, getRootDirFor, getUrl, getUrlChildPrefix, onDeleted, onRenamed
Methods inherited from interface hudson.model.ModelObject
getDisplayName
Methods inherited from interface hudson.model.ModifiableItemGroup
doCreateItem, doCreateItem
Methods inherited from interface jenkins.model.ModifiableTopLevelItemGroup
copy, createProject, createProjectFromXML
Methods 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
-