Package hudson.plugins.git.util
Class BuildData
java.lang.Object
hudson.plugins.git.util.BuildData
- All Implemented Interfaces:
Action,ModelObject,Serializable,Cloneable
@ExportedBean(defaultVisibility=999)
public class BuildData
extends Object
implements Action, Serializable, Cloneable
Captures the Git related information for a build.
This object is added to Actionable.getActions().
This persists the Git related information of that build.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionMap of branchname -> build(Branch name to last built SHA1).The last build that we did (among the values inbuildsByBranchName.)The URLs that have been referenced.The name of the SCM as given by the user. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRemoteUrl(String remoteUrl) clone()booleangetApi()Returns the build data display name, optionally with SCM name.getIndex()getLastBuild(org.eclipse.jgit.lib.ObjectId sha1) getLastBuildOfBranch(String branch) hudson.plugins.git.RevisionGets revision of the previous build.Run<?,?> booleanhasBeenBuilt(org.eclipse.jgit.lib.ObjectId sha1) Return true if the history shows this SHA1 has been built.booleanhasBeenReferenced(String remoteUrl) inthashCode()voidvoidvoidsetScmName(String scmName) booleanLikeequals(Object)but doesn't check the URL as strictly, since those can vary while still representing the same remote repository.toString()
-
Field Details
-
buildsByBranchName
Map of branchname -> build(Branch name to last built SHA1).This map contains all the branches we've built in the past (including the build that this
BuildDatais attached to) -
lastBuild
The last build that we did (among the values inbuildsByBranchName.) -
scmName
The name of the SCM as given by the user. -
remoteUrls
The URLs that have been referenced.
-
-
Constructor Details
-
BuildData
public BuildData() -
BuildData
-
BuildData
-
-
Method Details
-
getDisplayName
Returns the build data display name, optionally with SCM name. This string needs to be relatively short because it is displayed in a column with other short links. If it is lengthened, it causes the other data on the page to shift right. The page is then difficult to read.- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject- Returns:
- build data display name
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-
setIndex
- Parameters:
index- the index, indexes less than or equal to1will be discarded.
-
getIndex
- Returns:
- the index.
-
getOwningRun
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @CheckForNull public Run<?,?> getOwningRun() -
readResolve
-
hasBeenBuilt
public boolean hasBeenBuilt(org.eclipse.jgit.lib.ObjectId sha1) Return true if the history shows this SHA1 has been built. False otherwise.- Parameters:
sha1- SHA1 hash of commit- Returns:
- true if sha1 has been built
-
getLastBuild
-
saveBuild
-
getLastBuildOfBranch
-
getLastBuiltRevision
@Exported @CheckForNull public hudson.plugins.git.Revision getLastBuiltRevision()Gets revision of the previous build.- Returns:
- revision of the last build. May be null will be returned if nothing has been checked out (e.g. due to wrong repository or branch)
-
getBuildsByBranchName
-
setScmName
-
getScmName
-
addRemoteUrl
-
getRemoteUrls
-
hasBeenReferenced
-
clone
-
getApi
-
toString
-
similarTo
Likeequals(Object)but doesn't check the URL as strictly, since those can vary while still representing the same remote repository. -
equals
-
hashCode
public int hashCode()
-