com.nohrd.bike.Energy.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domain Show documentation
Show all versions of domain Show documentation
A library for reading data from a NOHrD Bike
The newest version!
package com.nohrd.bike
@Suppress("DataClassPrivateConstructor")
public data class Energy private constructor(val joules: Double) {
public companion object {
@JvmStatic
public fun fromJoules(value: Number): Energy {
return Energy(value.toDouble())
}
}
}
internal val Number.joules: Energy get() = Energy.fromJoules(this)