commonMain.dk.cachet.carp.common.application.data.HeartRate.kt Maven / Gradle / Ivy
Go to download
Helper classes and base types relied upon by all subsystems. This library does not contain any domain logic.
The newest version!
package dk.cachet.carp.common.application.data
import kotlinx.serialization.*
import kotlin.js.JsExport
/**
* Holds heart rate data in beats per minute ([bpm]).
*/
@Serializable
@SerialName( CarpDataTypes.HEART_RATE_TYPE_NAME )
@JsExport
data class HeartRate( val bpm: Int, override val sensorSpecificData: Data? = null ) : SensorData
{
init
{
require( bpm >= 0 ) { "Beats per minute needs to be a positive number." }
}
}