Enum Class Unit

java.lang.Object
java.lang.Enum<Unit>
com.perfino.annotation.Unit
All Implemented Interfaces:
Serializable, Comparable<Unit>, Constable

public enum Unit extends Enum<Unit>
Telemetry unit used in the TelemetryFormat annotation.
  • Enum Constant Details

    • PLAIN

      public static final Unit PLAIN
      The monitored value is a unitless number.
    • PER_SECOND

      public static final Unit PER_SECOND
      The monitored value has the unit "per second". Conversion into the units "per-minute" and "per-hour" is done automatically as required. In practice, this conversion would occur if TelemetryFormat.scale() is set to a negative number.
    • PERCENT

      public static final Unit PERCENT
      The monitored value has the unit "percent". To show two decimal digits, set TelemetryFormat.scale() to 2.
    • MILLISECONDS

      public static final Unit MILLISECONDS
      The monitored value has the unit "milliseconds". Conversion into higher unit prefixes such as seconds or minutes is done automatically as required.
    • MICROSECONDS

      public static final Unit MICROSECONDS
      The monitored value has the unit "microseconds". Conversion into higher unit prefixes such as seconds or minutes is done automatically as required.
    • NANOSECONDS

      public static final Unit NANOSECONDS
      The monitored value has the unit "nanoseconds". Conversion into higher unit prefixes such as microseconds or milliseconds is done automatically as required.
    • BYTES

      public static final Unit BYTES
      The monitored value has the unit "bytes". Conversion into higher unit prefixes such as kB, MB or GB is done automatically as required.
  • Method Details

    • values

      public static Unit[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Unit valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null