hudson.plugins.im.tools
Class BuildHelper

java.lang.Object
  extended by hudson.plugins.im.tools.BuildHelper

public class BuildHelper
extends java.lang.Object

Helper class to work with Hudson builds.

Author:
kutzi

Nested Class Summary
static class BuildHelper.ExtResult
          Extended result description of a build.
 
Method Summary
static BuildHelper.ExtResult getExtendedResult(hudson.model.AbstractBuild<?,?> build)
          Returns the extended result description of a build.
static hudson.model.AbstractBuild<?,?> getPreviousNonAbortedBuild(hudson.model.AbstractBuild<?,?> build)
          Returns the previous 'not aborted' build (i.e. ignores ABORTED and NOT_BUILT builds) or null.
static hudson.model.AbstractBuild<?,?> getPreviousSuccessfulBuild(hudson.model.AbstractBuild<?,?> build)
          Returns the previous successful build (i.e. build with result SUCCESS) or null.
static java.lang.String getProjectName(hudson.model.AbstractBuild<?,?> build)
          Returns the name of the project the build belongs to in a human readable format.
static java.lang.String getResultDescription(hudson.model.AbstractBuild<?,?> build)
          Returns a textual description of the result taking the previous build into account.
static boolean isFailureOrUnstable(hudson.model.AbstractBuild<?,?> build)
          Does what the name says.
static boolean isFix(hudson.model.AbstractBuild<?,?> build)
          Returns true if this build represents a 'fix'.
static boolean isStillFailureOrUnstable(hudson.model.AbstractBuild<?,?> build)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isFix

public static boolean isFix(hudson.model.AbstractBuild<?,?> build)
Returns true if this build represents a 'fix'. I.e. it is the first successful build after previous 'failed' and/or 'unstable' builds. Ignores 'aborted' and 'not built' builds.


isFailureOrUnstable

public static boolean isFailureOrUnstable(hudson.model.AbstractBuild<?,?> build)
Does what the name says.


isStillFailureOrUnstable

public static boolean isStillFailureOrUnstable(hudson.model.AbstractBuild<?,?> build)

getPreviousNonAbortedBuild

public static hudson.model.AbstractBuild<?,?> getPreviousNonAbortedBuild(hudson.model.AbstractBuild<?,?> build)
Returns the previous 'not aborted' build (i.e. ignores ABORTED and NOT_BUILT builds) or null.


getPreviousSuccessfulBuild

public static hudson.model.AbstractBuild<?,?> getPreviousSuccessfulBuild(hudson.model.AbstractBuild<?,?> build)
Returns the previous successful build (i.e. build with result SUCCESS) or null.


getResultDescription

public static java.lang.String getResultDescription(hudson.model.AbstractBuild<?,?> build)
Returns a textual description of the result taking the previous build into account. E.g. reports 'fixes' and 'still failing/unstable' builds.


getExtendedResult

public static BuildHelper.ExtResult getExtendedResult(hudson.model.AbstractBuild<?,?> build)
Returns the extended result description of a build.


getProjectName

public static java.lang.String getProjectName(hudson.model.AbstractBuild<?,?> build)
Returns the name of the project the build belongs to in a human readable format.



Copyright © 2010. All Rights Reserved.