DispenseTrait.DispenseItem

class DispenseTrait.DispenseItem


The state of a given disensible item.

Summary

Public constructors

DispenseItem(
    itemName: String,
    amountRemaining: DispenseTrait.Amount,
    amountLastDispensed: DispenseTrait.Amount,
    isCurrentlyDispensing: Boolean
)

Creates the DispenseItem class.

Public properties

DispenseTrait.Amount

Amount of that item that the device most recently dispensed.

DispenseTrait.Amount

Amount of that item remaining in the device.

Boolean

Indicates if the device is currently dispensing this item.

String

Name of the item.

Public constructors

DispenseItem

DispenseItem(
    itemName: String = "",
    amountRemaining: DispenseTrait.Amount = Amount(),
    amountLastDispensed: DispenseTrait.Amount = Amount(),
    isCurrentlyDispensing: Boolean = false
)

Creates the DispenseItem class.

Public properties

amountLastDispensed

val amountLastDispensedDispenseTrait.Amount

Amount of that item that the device most recently dispensed. If the device is currently dispensing, this should report the amount it dispensed prior to the current dispensing amount.

amountRemaining

val amountRemainingDispenseTrait.Amount

Amount of that item remaining in the device. If the device is currently dispensing, this reports the remaining amount or what the amount will be once the device finishes dispensing.

isCurrentlyDispensing

val isCurrentlyDispensingBoolean

Indicates if the device is currently dispensing this item.

itemName

val itemNameString

Name of the item.