use of jetbrains.buildServer.serverSide.buildDistribution.WaitReason in project teamcity-rest by JetBrains.
the class Build method getWaitReason.
@XmlElement(name = "waitReason")
public String getWaitReason() {
return ValueWithDefault.decideDefault(myFields.isIncluded("waitReason", false), () -> {
if (myQueuedBuild == null)
return null;
if (myQueuedBuild instanceof QueuedBuildEx) {
return ((QueuedBuildEx) myQueuedBuild).getLatestWaitReason();
}
// Fallback to old way of doing things.
final BuildEstimates buildEstimates = myQueuedBuild.getBuildEstimates();
if (buildEstimates == null)
return null;
final WaitReason waitReason = buildEstimates.getWaitReason();
if (waitReason == null)
return null;
return waitReason.getDescription();
});
}
Aggregations