public class TriggerContext extends Object
GerritCause
about what other builds were involved in the same event.
For backwards compatibility reasons this class is serialized by the help of the
XStream converter TriggerContextConverter
so any future additions to this class need to be handled in that class as well or it won't be serialized correctly.Constructor and Description |
---|
TriggerContext()
Default constructor.
|
TriggerContext(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Standard constructor.
|
TriggerContext(Run thisBuild,
com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
List<TriggeredItemEntity> others)
standard constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addOtherBuild(Run build)
Adds a build to the list of other builds if it doesn't exist in the list.
|
void |
addOtherProject(Job project)
Adds a project to the list of other projects if it doesn't exist in the list.
|
com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent |
getEvent()
The event for this context.
|
List<Run> |
getOtherBuilds()
Gets all the other builds in this context.
|
List<Job> |
getOtherProjects()
Gets all the other projects in this context.
|
List<TriggeredItemEntity> |
getOthers()
A list of builds that were triggered by the same event as "this" build.
|
List<TriggeredItemEntity> |
getSortedOthers()
Gets all the other entities in the most user friendly order.
|
TriggeredItemEntity |
getThisBuild()
The build that this context represents.
|
boolean |
hasOthers()
Tells if there are any other builds or projects in this context.
|
void |
setOthers(List<TriggeredItemEntity> otherBuilds)
A list of builds that were triggered by the same event as "this" build.
|
void |
setThisBuild(Run thisBuild)
The build that this context represents.
|
void |
setThisBuild(TriggeredItemEntity thisBuild)
The build that this context represents.
|
public TriggerContext(Run thisBuild, com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, List<TriggeredItemEntity> others)
thisBuild
- this build.event
- the event for this context.others
- the other building and untriggered builds.public TriggerContext(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event for this context.public TriggerContext()
public List<TriggeredItemEntity> getOthers()
public void setOthers(List<TriggeredItemEntity> otherBuilds)
TriggeredItemEntity.getBuild()
== null.
Do not use this method unless you are a serializer,
use addOtherBuild(hudson.model.Run)
for adding builds.
otherBuilds
- the builds.public TriggeredItemEntity getThisBuild()
public void setThisBuild(TriggeredItemEntity thisBuild)
thisBuild
- the build.public void setThisBuild(Run thisBuild)
thisBuild
- the build.public com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent getEvent()
public void addOtherBuild(Run build)
build
- the build to add.getOtherBuilds()
public void addOtherProject(Job project)
project
- the project to add.getOtherProjects()
public boolean hasOthers()
getOtherBuilds()
,
getOtherProjects()
public List<Run> getOtherBuilds()
public List<Job> getOtherProjects()
public List<TriggeredItemEntity> getSortedOthers()
Copyright © 2016–2019. All rights reserved.