FF4kConfiguration

@Serializable
data class FF4kConfiguration(val settings: FF4kSettings = FF4kSettings(), val features: Map<String, Feature> = emptyMap(), val properties: Map<String, Property<*>> = emptyMap())(source)

Represents the complete configuration for an FF4k instance.

This data class holds all the settings, feature flags, and properties that define the behavior of FF4k. It can be serialized to and deserialized from JSON, enabling configuration management through external files or resources.

Usage

Configuration can be loaded from JSON files using JsonFF4kConfigurationParser:

val parser = JsonFF4kConfigurationParser()
val config = parser.parseConfigurationResource("ff4k_config.json")

Or created programmatically:

val config = FF4kConfiguration(
settings = FF4kSettings(autoCreate = true),
features = mapOf("my-feature" to Feature(uid = "my-feature", isEnabled = true)),
properties = mapOf("timeout" to intProperty("timeout") { value = 30 })
)

See also

Constructors

Link copied to clipboard
constructor(settings: FF4kSettings = FF4kSettings(), features: Map<String, Feature> = emptyMap(), properties: Map<String, Property<*>> = emptyMap())

Properties

Link copied to clipboard

Map of feature flags keyed by their unique identifier.

Link copied to clipboard

Map of properties keyed by their name.

Link copied to clipboard

Global settings that control FF4k behavior.