Package hudson.model

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:
  • Constructor Details

    • HealthReport

      @Deprecated public HealthReport(int score, String iconUrl, String 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

      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.
      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 Details

    • 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:
      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.