DeviceEnergyManagementTrait.CostStruct

class DeviceEnergyManagementTrait.CostStruct


Indicates a generic mechanism for expressing the cost to run an appliance.

Summary

Public constructors

CostStruct(
    costType: DeviceEnergyManagementTrait.CostTypeEnum,
    value: Int,
    decimalPoints: UByte,
    currency: OptionalValue<UShort>
)

Creates the CostStruct class.

Public properties

DeviceEnergyManagementTrait.CostTypeEnum

The type of cost being represented.

OptionalValue<UShort>

Indicates the currency for the value in the Value field.

UByte

The number of digits to the right of the decimal point in the Value field.

Int

The value of the cost.

Public constructors

CostStruct

CostStruct(
    costType: DeviceEnergyManagementTrait.CostTypeEnum = CostTypeEnum.Financial,
    value: Int = 0,
    decimalPoints: UByte,
    currency: OptionalValue<UShort> = OptionalValue.absent()
)

Creates the CostStruct class.

Public properties

costType

val costTypeDeviceEnergyManagementTrait.CostTypeEnum

The type of cost being represented.

currency

val currencyOptionalValue<UShort>

Indicates the currency for the value in the Value field. The value of the currency field must match the values defined by ISO 4217.

decimalPoints

val decimalPointsUByte

The number of digits to the right of the decimal point in the Value field. For example, if the value is 102 and DecimalPointsis 2, this would represent a cost of 1.02.

value

val valueInt

The value of the cost. A positive number indicates a cost, and a negative number indicates a free benefit.