Package hudson.util
Class RunList<R extends Run>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<R>
hudson.util.RunList<R>
- All Implemented Interfaces:
Iterable<R>
,Collection<R>
,List<R>
- Author:
- Kohsuke Kawaguchi
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyTimestamp
(long start, long end) Filter the list by timestamp.Filter the list to completed builds.Filter the list to non-successful builds only.Deprecated.Returns elements that satisfy the given predicate.Creates a aRunList
combining all the runs of the supplied jobs.fromRuns
(Collection<? extends R> runs) get
(int index) Deprecated.seesize()
for why this violates lazy-loadingint
boolean
isEmpty()
iterator()
int
limit
(int n) Return only the most recent builds.Reduce the size of the list by only leaving relatively new ones.Filter the list to builds on a single node only Warning: this method mutates the original list and then returns it.overThresholdOnly
(Result threshold) Filter the list to builds above threshold.Filter the list to regression builds only.int
size()
subList
(int fromIndex, int toIndex) AbstractList.subList(int, int)
isn't very efficient on ourIterable
based implementation.Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, listIterator, listIterator, remove, removeRange, set
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
RunList
public RunList() -
RunList
-
RunList
-
RunList
-
-
Method Details
-
fromJobs
public static <J extends Job<J,R>, RunList<R> fromJobsR extends Run<J, R>> (Iterable<? extends J> jobs) Creates a aRunList
combining all the runs of the supplied jobs.- Type Parameters:
J
- the base class of job.R
- the base class of run.- Parameters:
jobs
- the supplied jobs.- Returns:
- the run list.
- Since:
- 2.37
-
iterator
-
size
-
get
-
subList
AbstractList.subList(int, int)
isn't very efficient on ourIterable
based implementation. In fact the range check alone would require us to iterate all the elements, so we'd be better off just copying into ArrayList. -
spliterator
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<R extends Run>
- Overrides:
lastIndexOf
in classAbstractList<R extends Run>
-
isEmpty
public boolean isEmpty() -
getFirstBuild
Deprecated.seesize()
for why this violates lazy-loading -
getLastBuild
-
fromRuns
-
filter
Returns elements that satisfy the given predicate. Warning: this method mutates the original list and then returns it.- Since:
- 2.279
-
filter
Deprecated.Returns elements that satisfy the given predicate. Warning: this method mutates the original list and then returns it.- Since:
- 1.544
-
limit
Return only the most recent builds. Warning: this method mutates the original list and then returns it.- Parameters:
n
- a count- Returns:
- the n most recent builds
- Since:
- 1.507
-
failureOnly
Filter the list to non-successful builds only. Warning: this method mutates the original list and then returns it. -
overThresholdOnly
Filter the list to builds above threshold. Warning: this method mutates the original list and then returns it.- Since:
- 1.517
-
completedOnly
Filter the list to completed builds. Warning: this method mutates the original list and then returns it.- Since:
- 1.561
-
node
Filter the list to builds on a single node only Warning: this method mutates the original list and then returns it. -
regressionOnly
Filter the list to regression builds only. Warning: this method mutates the original list and then returns it. -
byTimestamp
Filter the list by timestamp.s<=;e
. Warning: this method mutates the original list and then returns it. -
newBuilds
Reduce the size of the list by only leaving relatively new ones. This also removes on-going builds, as RSS cannot be used to publish information if it changes. Warning: this method mutates the original list and then returns it.
-
filter(Predicate)