Package hudson.util
Class PersistedList<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
hudson.util.PersistedList<T>
- All Implemented Interfaces:
- Iterable<T>,- Collection<T>,- List<T>
- Direct Known Subclasses:
- DescribableList
Collection whose change is notified to the parent object for persistence.
- Since:
- 1.333
- Author:
- Kohsuke Kawaguchi
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classConverterimplementation for XStream.
- 
Field SummaryFieldsFields inherited from class java.util.AbstractListmodCount
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedPersistedList(Saveable owner) protectedPersistedList(Collection<? extends T> initialList) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> items) voidaddAllTo(Collection<? super T> dst) voidclear()booleanget(int index) <U extends T>
 UGets all instances that matches the given type.booleanisEmpty()iterator()protected voidCalled when a list is mutated.voidRemoves an instance by its type.booleanvoidvoidA convenience method to replace a single item.voidreplaceBy(Collection<? extends T> col) voidintsize()<X> X[]toArray(X[] array) Gets all theDescribables in an array.toList()Returns the snapshot view of instances as list.toString()Methods inherited from class java.util.AbstractListadd, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods inherited from class java.util.AbstractCollectioncontainsAll, removeAll, retainAll, toArrayMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.ListcontainsAll, removeAll, replaceAll, retainAll, sort, spliterator, toArray
- 
Field Details- 
data
- 
owner
 
- 
- 
Constructor Details- 
PersistedListprotected PersistedList()
- 
PersistedList
- 
PersistedList
 
- 
- 
Method Details- 
setOwner
- 
add- Specified by:
- addin interface- Collection<T>
- Specified by:
- addin interface- List<T>
- Overrides:
- addin class- AbstractList<T>
 
- 
addAll- Specified by:
- addAllin interface- Collection<T>
- Specified by:
- addAllin interface- List<T>
- Overrides:
- addAllin class- AbstractCollection<T>
 
- 
replaceBy- Throws:
- IOException
 
- 
get
- 
get
- 
getAllGets all instances that matches the given type.
- 
sizepublic int size()- Specified by:
- sizein interface- Collection<T>
- Specified by:
- sizein interface- List<T>
- Specified by:
- sizein class- AbstractCollection<T>
 
- 
removeRemoves an instance by its type.- Throws:
- IOException
 
- 
replaceA convenience method to replace a single item. This method shouldn't be used when you are replacing a lot of stuff as copy-on-write semantics make this rather slow.- Throws:
- IOException
 
- 
remove- Specified by:
- removein interface- Collection<T>
- Specified by:
- removein interface- List<T>
- Overrides:
- removein class- AbstractCollection<T>
 
- 
removeAll- Throws:
- IOException
 
- 
clearpublic void clear()- Specified by:
- clearin interface- Collection<T>
- Specified by:
- clearin interface- List<T>
- Overrides:
- clearin class- AbstractList<T>
 
- 
iterator
- 
onModifiedCalled when a list is mutated.- Throws:
- IOException
 
- 
toListReturns the snapshot view of instances as list.
- 
toArraypublic <X> X[] toArray(X[] array) Gets all theDescribables in an array.- Specified by:
- toArrayin interface- Collection<T>
- Specified by:
- toArrayin interface- List<T>
- Overrides:
- toArrayin class- AbstractCollection<T>
 
- 
addAllTo
- 
isEmptypublic boolean isEmpty()- Specified by:
- isEmptyin interface- Collection<T>
- Specified by:
- isEmptyin interface- List<T>
- Overrides:
- isEmptyin class- AbstractCollection<T>
 
- 
contains- Specified by:
- containsin interface- Collection<T>
- Specified by:
- containsin interface- List<T>
- Overrides:
- containsin class- AbstractCollection<T>
 
- 
toString- Overrides:
- toStringin class- AbstractCollection<T>
 
 
-