AnalyticsValue

sealed interface AnalyticsValue(source)

A parameter or property value, carrying its type so adapters can hand vendors a real number rather than a number spelled as text.

The type decides what a dashboard can do with it: Firebase and Mixpanel can sum or average a numeric value and can only group a textual one. Vendors that accept strings only flatten it with asString.

This types the value, not its meaning — an Int called amount is still just a number to an adapter.

The variants are named for the Kotlin types they hold, so inside this declaration the wrapped types are spelled kotlin.String and so on.

Inheritors

Types

Link copied to clipboard
value class Boolean(val value: Boolean) : AnalyticsValue
Link copied to clipboard
value class Double(val value: Double) : AnalyticsValue
Link copied to clipboard
value class Float(val value: Float) : AnalyticsValue
Link copied to clipboard
value class Int(val value: Int) : AnalyticsValue
Link copied to clipboard
value class Long(val value: Long) : AnalyticsValue
Link copied to clipboard
value class String(val value: String) : AnalyticsValue

Properties

Link copied to clipboard

The value as a string-only vendor would see it.