Class Figure

java.lang.Object
org.gcube.common.health.api.Figure

public final class Figure extends Object
One figure of a group of Statistics: a number, or a distribution of numbers by name (e.g. the requests by outcome), with the label a page shows. A page draws a number as a tile and a distribution as a chart.
  • Method Details

    • number

      public static Figure number(String id, String label, Number value)
      Creates a figure that is a number.
      Parameters:
      id - the identifier of the figure in its group, lowerCamelCase
      label - what a page writes next to it, e.g. "Requests since start"
      value - the number
      Returns:
      the figure
    • distribution

      public static Figure distribution(String id, String label, Map<String,? extends Number> parts)
      Creates a figure that is a distribution of numbers by name, in the order given.
      Parameters:
      id - the identifier of the figure in its group, lowerCamelCase
      label - what a page writes next to it, e.g. "Requests by outcome"
      parts - the number of each part, by its name
      Returns:
      the figure
    • getId

      public String getId()
    • getLabel

      public String getLabel()
    • getValue

      public Object getValue()
      Returns the value: a Number, or an unmodifiable Map of numbers by name.
      Returns:
      the value
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object