MeasurementValueConfiguration

class MeasurementValueConfiguration(val name: String?, val scale: Scale, val precision: MeasurementPrecision) : ScaleAndPrecision

Configures a measurement value and consists of a Scale, MeasurementPrecision, and a name for this configuration. These properties describe how the actual measurement value is calculated and formatted for the measurement annotations. The name property is just to have the option to display a user-friendly name in the UI, it has no further use. If we ever check for duplicates, or try to find a specific MeasurementValueConfiguration in the document's configuration list, only scale and precision matter. That being said, the combination of scale and precision needs to be unique - you cannot have two MeasurementValueConfigurations in the document with same scale and precision. The name can be null, in that case the UI shows generated name.

See also

Constructors

Link copied to clipboard
constructor(name: String?, scale: Scale, precision: MeasurementPrecision)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val name: String?
Link copied to clipboard
open override val precision: MeasurementPrecision
Link copied to clipboard
open override val scale: Scale

Functions

Link copied to clipboard
fun equalsAll(other: Any?): Boolean

Compares name as well as scale and precision. The standard equals only checks what makes a unique MeasurementValueConfiguration, which is Scale and MeasurementPrecision.

Link copied to clipboard
fun getDefaultName(includePrecision: Boolean): String

Get the default generated name based on the scale.

Link copied to clipboard
fun getNameForDisplay(includePrecision: Boolean): String

Get the display name for this configuration.

Link copied to clipboard
open override fun hashCode(): Int