Package jenkins.model.lazy
Class BuildReference<R>
- java.lang.Object
-
- jenkins.model.lazy.BuildReference<R>
-
public final class BuildReference<R> extends Object
Reference (by default aSoftReference
) to a build object.To be able to re-retrieve the referent in case it is lost, this class remembers its ID (the job name is provided by the context because a
BuildReference
belongs to one and onlyAbstractLazyLoadRunMap
.)We use this ID for equality/hashCode so that we can have a collection of
BuildReference
and find things in it.- Since:
- 1.485 (but as of 1.548 not a
SoftReference
) - Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BuildReference.DefaultHolderFactory
Default factory if none other are installed.static interface
BuildReference.Holder<R>
An abstraction ofReference
.static interface
BuildReference.HolderFactory
Extensible factory for creating build references.
-
Constructor Summary
Constructors Constructor Description BuildReference(String id, R referent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
R
get()
Gets the build if still in memory.int
hashCode()
String
toString()
-
-
-
Method Detail
-
get
@CheckForNull public R get()
Gets the build if still in memory.- Returns:
- the actual build, or null if it has been collected
- See Also:
BuildReference.Holder.get()
-
-