Package com.perfino.annotation
Enum Unit
- java.lang.Object
-
- java.lang.Enum<Unit>
-
- com.perfino.annotation.Unit
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Unit>
public enum Unit extends java.lang.Enum<Unit>
Telemetry unit used in theTelemetryFormat
annotation.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BYTES
The monitored value has the unit "bytes".MICROSECONDS
The monitored value has the unit "microseconds".MILLISECONDS
The monitored value has the unit "milliseconds".NANOSECONDS
The monitored value has the unit "nanoseconds".PER_SECOND
The monitored value has the unit "per second".PERCENT
The monitored value has the unit "percent".PLAIN
The monitored value is a unitless number.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Unit
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Unit[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 ifTelemetryFormat.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, setTelemetryFormat.scale()
to2
.
-
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 Detail
-
values
public static Unit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Unit c : Unit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Unit valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-