hudson.model
Class HealthReport

java.lang.Object
  extended by hudson.model.HealthReport
All Implemented Interfaces:
Serializable, Comparable<HealthReport>

@ExportedBean(defaultVisibility=2)
public class HealthReport
extends Object
implements Serializable, Comparable<HealthReport>

Represents health of something (typically project). A number between 0-100.

Since:
1.115
Author:
connollys
See Also:
Serialized Form

Nested Class Summary
static class HealthReport.ConverterImpl
          Fix deserialization of older data.
 
Constructor Summary
HealthReport()
          Create a new HealthReport.
HealthReport(int score, org.jvnet.localizer.Localizable description)
          Create a new HealthReport.
HealthReport(int score, String description)
          Deprecated. since 2008-10-18. Use HealthReport(int, org.jvnet.localizer.Localizable)
HealthReport(int score, String iconUrl, org.jvnet.localizer.Localizable description)
          Create a new HealthReport.
HealthReport(int score, String iconUrl, String description)
          Deprecated. since 2008-10-18. Use HealthReport(int, String, org.jvnet.localizer.Localizable)
 
Method Summary
 int compareTo(HealthReport o)
          
 List<HealthReport> getAggregatedReports()
          Getter for property 'aggregatedReports'.
 String getDescription()
          Getter for property 'description'.
 String getIconUrl()
          Getter for property 'iconUrl'.
 String getIconUrl(String size)
          Get's the iconUrl relative to the hudson root url, for the correct size.
 org.jvnet.localizer.Localizable getLocalizableDescription()
          Getter for property 'localizibleDescription'.
 int getScore()
          Getter for property 'score'.
 boolean isAggregateReport()
          Getter for property 'aggregateReport'.
static HealthReport max(HealthReport a, HealthReport b)
          Utility method to find the report with the highest health.
static HealthReport min(HealthReport a, HealthReport b)
          Utility method to find the report with the lowest health.
 void setDescription(String description)
          Setter for property 'description'.
 void setIconUrl(String iconUrl)
          Setter for property 'iconUrl'.
 void setLocalizibleDescription(org.jvnet.localizer.Localizable localizibleDescription)
          Setter for property 'localizibleDescription'.
 void setScore(int score)
          Setter for property 'score'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HealthReport

@Deprecated
public HealthReport(int score,
                               String iconUrl,
                               String description)
Deprecated. since 2008-10-18. Use HealthReport(int, String, org.jvnet.localizer.Localizable)

Create a new HealthReport.

Parameters:
score - The percentage health score (from 0 to 100 inclusive).
iconUrl - The path to the icon corresponding to this Action's health or null to display the default icon corresponding to the current health score.

If the path begins with a '/' then it will be the absolute path, otherwise the image is assumed to be in one of /images/16x16/, /images/24x24/ or /images/32x32/ depending on the icon size selected by the user. When calculating the url to display for absolute paths, the getIconUrl(String) method will replace /32x32/ in the path with the appropriate size.

description - The health icon's tool-tip.

HealthReport

public HealthReport(int score,
                    String iconUrl,
                    org.jvnet.localizer.Localizable description)
Create a new HealthReport.

Parameters:
score - The percentage health score (from 0 to 100 inclusive).
iconUrl - The path to the icon corresponding to this Action's health or null to display the default icon corresponding to the current health score.

If the path begins with a '/' then it will be the absolute path, otherwise the image is assumed to be in one of /images/16x16/, /images/24x24/ or /images/32x32/ depending on the icon size selected by the user. When calculating the url to display for absolute paths, the getIconUrl(String) method will replace /32x32/ in the path with the appropriate size.

description - The health icon's tool-tip.

HealthReport

@Deprecated
public HealthReport(int score,
                               String description)
Deprecated. since 2008-10-18. Use HealthReport(int, org.jvnet.localizer.Localizable)

Create a new HealthReport.

Parameters:
score - The percentage health score (from 0 to 100 inclusive).
description - The health icon's tool-tip.

HealthReport

public HealthReport(int score,
                    org.jvnet.localizer.Localizable description)
Create a new HealthReport.

Parameters:
score - The percentage health score (from 0 to 100 inclusive).
description - The health icon's tool-tip.

HealthReport

public HealthReport()
Create a new HealthReport.

Method Detail

getScore

@Exported
public int getScore()
Getter for property 'score'.

Returns:
The percentage health score (from 0 to 100 inclusive).

setScore

public void setScore(int score)
Setter for property 'score'.

Parameters:
score - Value to set for property 'score'.

getIconUrl

@Exported
public String getIconUrl()
Getter for property 'iconUrl'.

Returns:
Value for property 'iconUrl'.

getIconUrl

public String getIconUrl(String size)
Get's the iconUrl relative to the hudson root url, for the correct size.

Parameters:
size - The size, e.g. 32x32, 24x24 or 16x16.
Returns:
The url relative to hudson's root url.

setIconUrl

public void setIconUrl(String iconUrl)
Setter for property 'iconUrl'.

Parameters:
iconUrl - Value to set for property 'iconUrl'.

getDescription

@Exported
public String getDescription()
Getter for property 'description'.

Returns:
Value for property 'description'.

setDescription

public void setDescription(String description)
Setter for property 'description'.

Parameters:
description - Value to set for property 'description'.

getLocalizableDescription

public org.jvnet.localizer.Localizable getLocalizableDescription()
Getter for property 'localizibleDescription'.

Returns:
Value for property 'localizibleDescription'.

setLocalizibleDescription

public void setLocalizibleDescription(org.jvnet.localizer.Localizable localizibleDescription)
Setter for property 'localizibleDescription'.

Parameters:
localizibleDescription - Value to set for property 'localizibleDescription'.

getAggregatedReports

public List<HealthReport> getAggregatedReports()
Getter for property 'aggregatedReports'.

Returns:
Value for property 'aggregatedReports'.

isAggregateReport

public boolean isAggregateReport()
Getter for property 'aggregateReport'.

Returns:
Value for property 'aggregateReport'.

compareTo

public int compareTo(HealthReport o)

Specified by:
compareTo in interface Comparable<HealthReport>

min

public static HealthReport min(HealthReport a,
                               HealthReport b)
Utility method to find the report with the lowest health.


max

public static HealthReport max(HealthReport a,
                               HealthReport b)
Utility method to find the report with the highest health.



Copyright © 2004-2013. All Rights Reserved.