Class HealthReport
- java.lang.Object
-
- 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
Nested Classes Modifier and Type Class Description static classHealthReport.ConverterImplFix deserialization of older data.
-
Constructor Summary
Constructors Constructor Description HealthReport()Create a new HealthReport.HealthReport(int score, String description)Deprecated.since 2008-10-18.HealthReport(int score, String iconUrl, String description)Deprecated.since 2008-10-18.HealthReport(int score, String iconUrl, org.jvnet.localizer.Localizable description)Create a new HealthReport.HealthReport(int score, org.jvnet.localizer.Localizable description)Create a new HealthReport.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(HealthReport o)List<HealthReport>getAggregatedReports()Getter for property 'aggregatedReports'.StringgetDescription()Getter for property 'description'.StringgetIconClassName()Get health status icon class.StringgetIconUrl()Getter for property 'iconUrl'.StringgetIconUrl(String size)Get's the iconUrl relative to the hudson root url, for the correct size.org.jvnet.localizer.LocalizablegetLocalizableDescription()Getter for property 'localizibleDescription'.intgetScore()Getter for property 'score'.booleanisAggregateReport()Getter for property 'aggregateReport'.static HealthReportmax(HealthReport a, HealthReport b)Utility method to find the report with the highest health.static HealthReportmin(HealthReport a, HealthReport b)Utility method to find the report with the lowest health.voidsetDescription(String description)Setter for property 'description'.voidsetIconUrl(String iconUrl)Setter for property 'iconUrl'.voidsetLocalizibleDescription(org.jvnet.localizer.Localizable localizibleDescription)Setter for property 'localizibleDescription'.voidsetScore(int score)Setter for property 'score'.
-
-
-
Constructor Detail
-
HealthReport
@Deprecated public HealthReport(int score, String iconUrl, String description)
Deprecated.since 2008-10-18. UseHealthReport(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 thisAction's health ornullto 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 thisAction's health ornullto 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. UseHealthReport(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'.
-
getIconClassName
@Exported public String getIconClassName()
Get health status icon class.- Returns:
- The health status icon class.
-
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:
compareToin interfaceComparable<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.
-
-