com.atlassian.bamboo.build
Class BuildStatusHelper

java.lang.Object
  extended by com.atlassian.bamboo.build.BuildStatusHelper

public class BuildStatusHelper
extends java.lang.Object


Constructor Summary
BuildStatusHelper(Build build, BuildResultsSummary currentBuildResult, BuildResultsSummaryManager buildResultsSummaryManager)
           
BuildStatusHelper(BuildResultsSummaryManager buildResultsSummaryManager, Build build, int buildNumber)
           
 
Method Summary
 Build getBuild()
           
 int getCountFailingSince()
           
 int getCountSucceedingSince()
           
 BuildResultsSummary getFailingSinceBuild()
          If the currentBuildResult is set and failing then return first failed BuildResultSummary in series.
 BuildResultsSummary getFirstBuildInSequence()
          Poorly name method.
 BuildResultsSummary getFixedInBuild()
          If the currentBuildResult is set and not successful then return first successful BuildResultSummary after this one.
 BuildResultsSummary getFixesBuild()
          If the currentBuildResult is set and successful then return first failed BuildResultSummary in series that preceded currentBuildResult.
 BuildResultsSummary getPreviousSuccessfulBuild()
           
 BuildResultsSummary getSucceedingSinceBuild()
          If the currentBuildResult is set and successful then return first successful BuildResultSummary in series.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildStatusHelper

public BuildStatusHelper(@NotNull
                         Build build,
                         @NotNull
                         BuildResultsSummary currentBuildResult,
                         @NotNull
                         BuildResultsSummaryManager buildResultsSummaryManager)

BuildStatusHelper

public BuildStatusHelper(@NotNull
                         BuildResultsSummaryManager buildResultsSummaryManager,
                         @NotNull
                         Build build,
                         int buildNumber)
Method Detail

getFixedInBuild

@Nullable
public BuildResultsSummary getFixedInBuild()
If the currentBuildResult is set and not successful then return first successful BuildResultSummary after this one. Returns null if currentBuildResult is not set or currentBuildResult is set and successful or if there was no successful build after this one.

Returns:
first successful BuildResultSummary after this one

getPreviousSuccessfulBuild

@Nullable
public BuildResultsSummary getPreviousSuccessfulBuild()
Returns:
previous successful BuildResultSummary or null if none found

getFailingSinceBuild

@Nullable
public BuildResultsSummary getFailingSinceBuild()
If the currentBuildResult is set and failing then return first failed BuildResultSummary in series. Returns null if: - currentBuildResult is not set, or - currentBuildResult is set and not failing

Returns:
first failing BuildResultSummary in a series that contains currentBuildResult

getFixesBuild

@Nullable
public BuildResultsSummary getFixesBuild()
If the currentBuildResult is set and successful then return first failed BuildResultSummary in series that preceded currentBuildResult. Returns null if: - currentBuildResult is not set, or - currentBuildResult is set and not successful, or - previous successful BuildResultSummary is not found, or - failing build not found between previous successful BuildResultSummary and currentBuildResult

Returns:
first failed BuildResultSummary in series that preceded currentBuildResult

getCountFailingSince

public int getCountFailingSince()
Returns:
number of failing BuildResultSummary preceding and including currentBuildResult in a series, 0 if conditions for getFailingSinceBuild() are not met

getSucceedingSinceBuild

@Nullable
public BuildResultsSummary getSucceedingSinceBuild()
If the currentBuildResult is set and successful then return first successful BuildResultSummary in series. Returns null if: - currentBuildResult is not set, or - currentBuildResult is set and not successful

Returns:
first successful BuildResultSummary in a series that contains currentBuildResult

getCountSucceedingSince

public int getCountSucceedingSince()
Returns:
number of successful BuildResultSummary preceding and including currentBuildResult in a series, 0 if conditions for getSucceedingSinceBuild() are not met

getBuild

public Build getBuild()

getFirstBuildInSequence

@Nullable
public BuildResultsSummary getFirstBuildInSequence()
Poorly name method. Returns the first BuildResultsSummary in this sequence. Essentially, it tries to find the first failing build, failing that it finds the build that this build fixes

Returns:
May return null if neither conditions are met


Copyright © 2010 Atlassian. All Rights Reserved.