ConfigKey

data class ConfigKey(val id: String, val description: String, val valueType: ConfigValueType, val defaultValue: ConfigValue, val allowedValues: List<String>? = null)

A typed remote config key with a compiled-in default.

Unlike Novalingo's original version, this generic ConfigKey carries no built-in registry — apps own their own object AppConfigKeys { val ALL_KEYS = listOf(...) } and pass it to whatever debug override UI they build on top of RemoteConfigClient.allValues.

Construction validates that defaultValue matches valueType (and, for constrained string keys, that the default is one of allowedValues), so a mistyped key fails at startup instead of silently resolving the wrong type later. Prefer the typed factories:

object AppConfigKeys {
val NEW_ONBOARDING = ConfigKey.bool("new_onboarding", "Show the redesigned onboarding", false)
val THEME = ConfigKey.string("theme", "UI theme", "system", allowedValues = listOf("light", "dark", "system"))
val ALL_KEYS = listOf(NEW_ONBOARDING, THEME)
}

Constructors

Link copied to clipboard
constructor(id: String, description: String, valueType: ConfigValueType, defaultValue: ConfigValue, allowedValues: List<String>? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

When set, the value is constrained to this fixed set of well-known choices. A debug override UI can render a dropdown instead of a free-text field. Only meaningful for ConfigValueType.STRING keys.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: String
Link copied to clipboard

Functions

Link copied to clipboard

True when value has this key's type and, for constrained string keys, is an allowed choice.