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
BuildReferencebelongs to one and onlyAbstractLazyLoadRunMap.)We use this ID for equality/hashCode so that we can have a collection of
BuildReferenceand 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 classBuildReference.DefaultHolderFactoryDefault factory if none other are installed.static interfaceBuildReference.Holder<R>An abstraction ofReference.static interfaceBuildReference.HolderFactoryExtensible 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 booleanequals(Object o)Rget()Gets the build if still in memory.inthashCode()StringtoString()
-
-
-
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()
-
-