Enum MeasurementUnit

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MeasurementUnit>

    public enum MeasurementUnit
    extends java.lang.Enum<MeasurementUnit>
    provide the measurement unit to be used with the statistics.

    Consists of:

    • measurment unit [V, W, Wh, %]
    • precision as double to multiply with the gathered Integerv
    Sample: The Voltage is measured in 'V' (Volt) and has a precision of '0.001'. The number 237123 provided by the statistics must be multiplied by the precision which gives us 237.123 V.
    • Method Detail

      • values

        public static MeasurementUnit[] 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 (MeasurementUnit c : MeasurementUnit.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MeasurementUnit 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 name
        java.lang.NullPointerException - if the argument is null
      • getUnit

        public java.lang.String getUnit()
      • getPrescision

        public java.lang.Number getPrescision()
      • getMapper

        public java.lang.Class<?> getMapper()
      • getMatchingMeasurementUnit

        public static MeasurementUnit getMatchingMeasurementUnit​(java.lang.Class<?> caller)